C# 클래스 _3PA.Npp

This class contains very generic wrappers for basic Notepad++ functionality.
파일 보기 프로젝트 열기: jcaillon/3P 1 사용 예제들

Private Properties

프로퍼티 타입 설명

공개 메소드들

메소드 설명
AddSelection ( int caret, int anchor ) : void

Adds an additional selection range to the existing main selection.

A main selection must first have been set by a call to SetSelection.

AnnotationClearAll ( ) : void

Clear all annotations in one go

AutoCCancel ( ) : void

Cancels any displayed autocompletion list.

AutoCStops ( string chars ) : void

Specifies the characters that will automatically cancel autocompletion without the need to call AutoCCancel.

Characters specified should be limited to printable ASCII characters.

BeginUndoAction ( ) : void

Mark the beginning of a set of operations that you want to undo all as one operation but that you have to generate as several operations. Alternatively, you can use these to mark a set of operations that you do not want to have combined with the preceding or following operations if they are undone.

BitmapToArgb ( Bitmap image ) : byte[]
BraceBadLight ( int position ) : void

Styles the specified character position with the Style.BraceBad style when there is an unmatched brace.

BraceHighlight ( int position1, int position2 ) : void

Styles the specified character positions with the Style.BraceLight style.

Brace highlighting can be removed by specifying InvalidPosition for position1 and position2.

BraceMatch ( int position ) : int

Finds a corresponding matching brace starting at the position specified. The brace characters handled are '(', ')', '[', ']', '{', '}', '<', and '>'.

A match only occurs if the style of the matching brace is the same as the starting brace. Nested braces are handled correctly.

ByteToCharStyles ( byte styles, byte text, int length, Encoding encoding ) : byte[]
CharPositionFromPointClose ( int x, int y ) : int

Finds the closest character position to the specified display point or returns -1 if the point is outside the window or not close to any characters.

CharToByteStyles ( byte styles, byte text, int length, Encoding encoding ) : byte[]
Clamp ( int value, int min, int max ) : int

Forces a value between a minimum and a maximum

ClampMin ( int value, int min ) : int

Forces a value to a minimum

Clear ( ) : void

Removes the selected text from the document.

ClearAll ( ) : void

Deletes all document text, unless the document is read-only.

ClearDocumentStyle ( ) : void

Removes all styling from the document and resets the folding state.

ClearSelections ( ) : void

Sets a single empty selection at the start of the document.

Colorize ( int startPos, int endPos ) : void

Requests that the current lexer restyle the specified range.

This will also cause fold levels in the range specified to be reset.

ConvertEols ( Eol eolMode ) : void

Changes all end-of-line characters in the document to the format specified.

Copy ( ) : void

Copies the selected text from the document and places it on the clipboard.

CopyAllowLine ( ) : void

Copies the selected text from the document and places it on the clipboard. If the selection is empty the current line is copied.

If the selection is empty and the current line copied, an extra "MSDEVLineSelect" marker is added to the clipboard which is then used in Paste to paste the whole line before the current line.

CopyRange ( int start, int end ) : void

Copies the specified range of text to the clipboard.

Cut ( ) : void

Cuts the selected text from the document and places it on the clipboard.

DeleteTextByRange ( int start, int end ) : void

Deletes the given range of text

DocLineFromVisible ( int displayLine ) : int

Returns the zero-based document line index from the specified display line index.

DropSelection ( int selection ) : void

If there are multiple selections, removes the specified selection.

EndUndoAction ( ) : void

Mark the end of a set of operations that you want to undo all as one operation but that you have to generate as several operations. Alternatively, you can use these to mark a set of operations that you do not want to have combined with the preceding or following operations if they are undone.

ExecuteCmd ( System.Windows.Forms.Command sciCommand ) : void

Performs the specified command

Exit ( ) : void

Leaves npp

FoldAll ( FoldAction action ) : void

Performs the specified fold action on the entire document.

When using FoldAction.Toggle the first fold header in the document is examined to decide whether to expand or contract.

GetAblWordAtPosition ( int position ) : string

Returns the ABL word at the given position (read on left and right) (stops at points)

GetBytes ( char text, int length, Encoding encoding, bool zeroTerminated ) : byte[]

Returns char array's bytes array with given encoding

GetBytes ( string text, Encoding encoding, bool zeroTerminated ) : byte[]

Returns a string's bytes array with given encoding

GetCaretScreenLocation ( ) : Point

Gets the current screen location of the caret.

GetColumn ( int position ) : int

Returns the column number of the specified document position, taking the width of tabs into account.

GetConfigDir ( ) : string

Returns the configuration directory path e.g. /plugins/config/{AssemblyProduct}

GetCurrentFileExtension ( ) : string

returns the current file's extension

GetCurrentFileFolder ( ) : string

Returns the current file folder (uses GetDirectoryName)

GetCurrentFileName ( ) : string

Returns the current file base name (uses GetFileName)

GetCurrentFilePath ( ) : string

Gets the path of the current document.

GetEndStyled ( ) : int

Returns the last document position likely to be styled correctly.

GetFirstWordRightAfterPoint ( int curPos ) : string

returns the first keyword right after the point (reading from right to left) it is useful to get a table name when we enter a field, or a database name when we enter a table name, also, if you analyse DATABASE.TABLE.CURFIELD, if returns TABLE and not DATABASE!

GetFocus ( ) : bool

to be tested!!!!

GetIndentString ( ) : string

returns the indent value as a string, can be either a \t or a number of ' '

GetIndicator ( int index ) : Indicator

Returns an indicator object Range of indicator id to use is from 8=INDIC_CONTAINER .. to 31=INDIC_IME-1

GetKeyword ( int curPos = -1 ) : string

Gets the keyword at given position (reading only on the left of the position)

GetLine ( ) : Line

Returns a Line object representing the current line

GetLine ( int index ) : Line

Returns a Line object representing the given line

GetMargin ( int index ) : Margin

Returns a margin object The margins are numbered 0 to 4. Using a margin number outside the valid range has no effect. By default, margin 0 is set to display line numbers, but is given a width of 0, so it is hidden. Margin 1 is set to display non-folding symbols and is given a width of 16 pixels, so it is visible. Margin 2 is set to display the folding symbols, but is given a width of 0, so it is hidden. Of course, you can set the margins to be whatever you wish.

GetMarker ( int index ) : Marker

Returns a marker object There are 32 markers, numbered 0 to MARKER_MAX (31), and you can assign any combination of them to each line in the document Marker numbers 25 to 31 are used by Scintilla in folding margins Marker numbers 0 to 24 have no pre-defined function; you can use them

GetNppDirectory ( ) : string

returns npp's folder path

GetOpenedFiles ( ) : List

Gets the file path of each file currently opened

GetOpenedFilesPrimary ( ) : List

Gets the file path of each file currently opened in the primary view

GetOpenedFilesSecondary ( ) : List

Gets the file path of each file currently opened in the secondary view

GetPointXyFromPosition ( int position ) : Point

returns the x,y point location of the character at the position given

GetPosFromLineColumn ( int line, int column ) : int

This message returns the position of a column on a line taking the width of tabs into account. It treats a multi-byte character as a single column. Column numbers, like lines start at 0.

GetPositionFromMouseLocation ( ) : int

Self explaining

GetScintillaRectangle ( ) : Rectangle

returns a rectangle representing the location and size of the scintilla window

GetSelection ( int index ) : Selection

Returns a selection object

GetSessionFiles ( string sessionFilePath ) : string

Gets the file path of each file in the session file, return the files separated by a new line

GetString ( IntPtr bytes, int length, Encoding encoding ) : string

Get string from pointer

GetStyle ( byte index ) : Style

Returns a style object There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255). There are also some predefined numbered styles starting at 32.

GetStyleAt ( int position ) : int

Gets the style of the specified document position.

GetTag ( int tagNumber ) : string

Returns the capture group text of the most recent regular expression search.

GetTextBetween ( Point point ) : string
GetTextByRange ( int start, int end ) : string

Gets a range of text from the document.

GetTextOnLeftOfPos ( int curPos, int maxLenght = KeywordMaxLength ) : string

returns the text on the left of the position... it will always return empty string at minima

GetTextOnRightOfPos ( int curPos, int maxLenght = KeywordMaxLength ) : string

returns the text on the right of the position... it will always return empty string at minima

GetTextRange ( int position, int length ) : string

Gets a range of text from the document.

GoBackFromDefinition ( ) : void

When you use the GoToDefinition method, you stack points of your position before the jump, this method allows you to navigate back to where you were

GoToLine ( int line ) : void

Move the caret and the view to the specified line (lines starts 0!)

Goto ( string document, int line = -1, int column = -1 ) : void

Switch to a document, can be already opended or not

Goto ( string document, int position, int line, int column, bool saveHistoric ) : void

Switch to a document, can be already opended or not, can decide to remember the current position to jump back to it

GotoPos ( string document, int position ) : void

Switch to a document, can be already opended or not

GotoPosition ( int position ) : void

Navigates the caret to the document position specified.

Any selection is discarded.

GrabFocus ( ) : void

allows scintilla to grab focus

HideLines ( int lineStart, int lineEnd ) : void

Hides the range of lines specified.

InsertText ( int position, string text ) : void

Inserts text at the specified position.

No scrolling is performed.

IsCurrentFileHasExtension ( string extension ) : bool

Determines whether the current file has the specified extension (e.g. ".cs").

Note it is case insensitive.

LineFromPosition ( int position ) : int

Returns the line that contains the document position specified.

LineScroll ( int lines, int columns ) : void

Scrolls the display the number of lines and columns specified.

Negative values scroll in the opposite direction. A column is the width in pixels of a space character in the Style.Default style.

LoadCurrentSession ( string file ) : void
ModifyTextAroundCaret ( int offsetStart, int offsetEnd, string text ) : void

Use this method to modify the text around the caret, it's good because :

- it's wrapped around beginundo/endundo which allows the user to CTRL+Z all the actions as one

- it handles the modification around ALL the carets -> good for multiselection

NewDocument ( string text ) : void

displays the input text into a new document

OpenFile ( string file ) : bool

Opens given file in notepad++

Paste ( ) : void

Pastes the contents of the clipboard into the current selection.

PointXFromPosition ( int pos ) : int

Returns the X display pixel location of the specified document position.

PointYFromPosition ( int pos ) : int

Returns the Y display pixel location of the specified document position.

RebuildLinesInfo ( ) : void

Call this to rebuild the lines information from scratch

ReplaceKeywordWrapped ( string keyword, int offset ) : void

Replaces the left part of the keyword found at (CurrentPosition + offset) by the keyword given (all wrapped in an undo action + handles multiselection)

ReplaceSelection ( string text ) : void

Replaces the current selection with the specified text.

If there is not a current selection, the text will be inserted at the current caret position. Following the operation the caret is placed at the end of the inserted text and scrolled into view. Does nothing if string is null or empty?

ReplaceTarget ( string text ) : int

Replaces the target defined by TargetStart and TargetEnd with the specified text.

The TargetStart and TargetEnd properties will be updated to the start and end positions of the replaced text. The recommended way to delete text in the document is to set the target range to be removed and replace the target with an empty string.

ReplaceTargetRe ( string text ) : int

Replaces the target text defined by TargetStart and TargetEnd with the specified value after first substituting "\1" through "\9" macros in the text with the most recent regular expression capture groups.

The "\0" macro will be substituted by the entire matched text from the most recent search. The TargetStart and TargetEnd properties will be updated to the start and end positions of the replaced text.

RotateSelection ( ) : void

Makes the next selection the main selection.

RunCommand ( NppMenuCmd cmd ) : void

Allows to execute one of Npp's command

SaveCurrentDocument ( ) : void

Saves the current document.

SaveCurrentSession ( string file ) : void
SaveSession ( string sessionFilePath ) : bool

Saves the session into a file

ScrollCaret ( ) : void

Scrolls the current position into view, if it is not already visible.

ScrollRange ( int start, int end ) : void

Scrolls the specified range into view.

This may be used to make a search match visible.

SearchInTarget ( string text ) : int

Searches for the first occurrence of the specified text in the target defined by TargetStart and TargetEnd.

If successful, the TargetStart and TargetEnd properties will be updated to the start and end positions of the matched text. Searching can be performed in reverse using a TargetStart greater than the TargetEnd.

SelectAll ( ) : void

Selects all the text in the document.

The current position is not scrolled into view.

SetAdditionalSelectionColor ( bool use, Color bg, Color fg ) : void

Sets a global override to the additional selections background + foreground color.

SetCommand ( int index, string commandName, System.Action functionPointer, ShortcutKey shortcut = newShortcutKey(), bool checkOnInit = false ) : void

Creates entry in the FuncItems list, which list the menu entry displayed in Npp's plugin menu

SetEmptySelection ( int pos ) : void

Removes any selection and places the caret at the specified position.

The caret is not scrolled into view.

SetFoldMarginColors ( bool use, Color bgColor, Color fgColor ) : void

allow changing the colour of the fold margin and fold margin highlight

SetFoldMarginMarkersColor ( Color bgColor, Color fgColor, Color activeColor ) : void

allow changing the colour of the fold margin and fold margin highlight

SetHotSpotActiveColor ( bool use, Color fg, Color bg ) : void

While the cursor hovers over text in a style with the hotspot attribute set, the default colouring can be modified

SetIndentGuideColor ( Color bg, Color fg ) : void

sets the fore/background color of the IndentGuide, overriding the lexer's

SetSel ( int pos ) : void

Sets the current carret position + the current anchor position to the same position

SetSel ( int anchorPos, int currentPos ) : void

Sets the anchor and current position.

A negative value for currentPos signifies the end of the document. A negative value for anchorPos signifies no selection (set the anchorPos to the same as the currentPos). The current position is scrolled into view following this operation.

SetSelection ( int caret ) : void

Set a single selection from anchor to caret as the ONLY selection.

SetSelection ( int caret, int anchor ) : void

Set a single selection from anchor to caret as the ONLY selection.

SetSelectionColor ( bool use, Color bg, Color fg ) : void

Sets a global override to the selection background + foreground color.

SetStatusbarLabel ( string labelText ) : string

Sets the label in the status of npp (bottom right)

WARNING : THIS METHOD IS HIGHLY UNSTABLE, USE ONLY FOR DEBUG!

SetStyling ( int length, int style ) : void

Styles the specified length of characters.

The styling position is advanced by length after each call allowing multiple calls to SetStyling for a single call to StartStyling.

SetTargetRange ( int start, int end ) : void

Sets the TargetStart and TargetEnd properties in a single call.

SetTextByRange ( int start, int end, string text ) : void

Sets the text of a specific range, can and must be used to delete text from range

SetToolbarImage ( Bitmap image, int pluginId ) : void

Helper to add a clickable icon in the toolbar

SetWhiteSpaceColor ( bool use, Color bg, Color fg ) : void

sets the fore/background color of the whitespaces, overriding the lexer's

ShowInactiveTopmost ( Form frm ) : void
ShowLines ( int lineStart, int lineEnd ) : void

Shows the range of lines specified.

StartBytePosOfLine ( int line ) : int

Returns the !! BYTE !! position of the start of given line Don't use THIS unless you know what you are doing with it!!!

StartRecordMacro ( ) : IntPtr
StartStyling ( int position ) : void

Prepares for styling by setting the styling position to start at.

After preparing the document for styling, use successive calls to SetStyling to style the document.

StyleClearAll ( ) : void

Resets all style properties to those currently configured for the Style.Default style.

StyleResetDefault ( ) : void

Resets the Style.Default style to its initial state.

StyleTextEx ( int startPos, byte styleArray ) : void

TODO: UNTESTED set the style of a text from startPos to startPos + styleArray.Length, the styleArray is a array of bytes, each byte is the style number to the corresponding text byte

SwapMainAnchorCaret ( ) : void

Moves the caret to the opposite end of the main selection.

SwitchToDocument ( string doc ) : void

Switch to given document

TargetFromSelection ( ) : void

Sets the TargetStart and TargetEnd to the start and end positions of the selection.

TargetWholeDocument ( ) : void

Sets the TargetStart and TargetEnd to the start and end positions of the document.

TextHeight ( int line ) : int

Retrieve the height of a particular line of text in pixels.

TextWidth ( int style, string text ) : int

Measures the width in pixels of the specified string when rendered in the specified style.

Undo ( ) : void

Undo previous action

UpdateLinesInfo ( SCNotification scn, bool isInsertion ) : void

Call this on SCN_MODIFIED event from scintilla to update the info on lines

UpdateScintilla ( bool reverse = false ) : void

Updates the current scintilla handle for Npp's functions Called when the user changes the current document

ZoomIn ( ) : void

Increases the zoom factor by 1 until it reaches 20 points.

ZoomOut ( ) : void

Decreases the zoom factor by 1 until it reaches -10 points.

메소드 상세

AddSelection() 공개 정적인 메소드

Adds an additional selection range to the existing main selection.
A main selection must first have been set by a call to SetSelection.
public static AddSelection ( int caret, int anchor ) : void
caret int The zero-based document position to end the selection.
anchor int The zero-based document position to start the selection.
리턴 void

AnnotationClearAll() 공개 정적인 메소드

Clear all annotations in one go
public static AnnotationClearAll ( ) : void
리턴 void

AutoCCancel() 공개 정적인 메소드

Cancels any displayed autocompletion list.
public static AutoCCancel ( ) : void
리턴 void

AutoCStops() 공개 정적인 메소드

Specifies the characters that will automatically cancel autocompletion without the need to call AutoCCancel.
Characters specified should be limited to printable ASCII characters.
public static AutoCStops ( string chars ) : void
chars string A String of the characters that will cancel autocompletion. The default is empty.
리턴 void

BeginUndoAction() 공개 정적인 메소드

Mark the beginning of a set of operations that you want to undo all as one operation but that you have to generate as several operations. Alternatively, you can use these to mark a set of operations that you do not want to have combined with the preceding or following operations if they are undone.
public static BeginUndoAction ( ) : void
리턴 void

BitmapToArgb() 공개 정적인 메소드

public static BitmapToArgb ( Bitmap image ) : byte[]
image System.Drawing.Bitmap
리턴 byte[]

BraceBadLight() 공개 정적인 메소드

Styles the specified character position with the Style.BraceBad style when there is an unmatched brace.
public static BraceBadLight ( int position ) : void
position int /// The zero-based document position of the unmatched brace character or InvalidPosition to remove /// the highlight. ///
리턴 void

BraceHighlight() 공개 정적인 메소드

Styles the specified character positions with the Style.BraceLight style.
Brace highlighting can be removed by specifying InvalidPosition for position1 and position2.
public static BraceHighlight ( int position1, int position2 ) : void
position1 int The zero-based document position of the open brace character.
position2 int The zero-based document position of the close brace character.
리턴 void

BraceMatch() 공개 정적인 메소드

Finds a corresponding matching brace starting at the position specified. The brace characters handled are '(', ')', '[', ']', '{', '}', '<', and '>'.
A match only occurs if the style of the matching brace is the same as the starting brace. Nested braces are handled correctly.
public static BraceMatch ( int position ) : int
position int /// The zero-based document position of a brace character to start the search from for a matching /// brace character. ///
리턴 int

ByteToCharStyles() 공개 정적인 메소드

public static ByteToCharStyles ( byte styles, byte text, int length, Encoding encoding ) : byte[]
styles byte
text byte
length int
encoding System.Text.Encoding
리턴 byte[]

CharPositionFromPointClose() 공개 정적인 메소드

Finds the closest character position to the specified display point or returns -1 if the point is outside the window or not close to any characters.
public static CharPositionFromPointClose ( int x, int y ) : int
x int The x pixel coordinate within the client rectangle of the control.
y int The y pixel coordinate within the client rectangle of the control.
리턴 int

CharToByteStyles() 공개 정적인 메소드

public static CharToByteStyles ( byte styles, byte text, int length, Encoding encoding ) : byte[]
styles byte
text byte
length int
encoding System.Text.Encoding
리턴 byte[]

Clamp() 공개 정적인 메소드

Forces a value between a minimum and a maximum
public static Clamp ( int value, int min, int max ) : int
value int
min int
max int
리턴 int

ClampMin() 공개 정적인 메소드

Forces a value to a minimum
public static ClampMin ( int value, int min ) : int
value int
min int
리턴 int

Clear() 공개 정적인 메소드

Removes the selected text from the document.
public static Clear ( ) : void
리턴 void

ClearAll() 공개 정적인 메소드

Deletes all document text, unless the document is read-only.
public static ClearAll ( ) : void
리턴 void

ClearDocumentStyle() 공개 정적인 메소드

Removes all styling from the document and resets the folding state.
public static ClearDocumentStyle ( ) : void
리턴 void

ClearSelections() 공개 정적인 메소드

Sets a single empty selection at the start of the document.
public static ClearSelections ( ) : void
리턴 void

Colorize() 공개 정적인 메소드

Requests that the current lexer restyle the specified range.
This will also cause fold levels in the range specified to be reset.
public static Colorize ( int startPos, int endPos ) : void
startPos int The zero-based document position at which to start styling.
endPos int The zero-based document position at which to stop styling (exclusive).
리턴 void

ConvertEols() 공개 정적인 메소드

Changes all end-of-line characters in the document to the format specified.
public static ConvertEols ( Eol eolMode ) : void
eolMode Eol One of the Eol enumeration values.
리턴 void

Copy() 공개 정적인 메소드

Copies the selected text from the document and places it on the clipboard.
public static Copy ( ) : void
리턴 void

CopyAllowLine() 공개 정적인 메소드

Copies the selected text from the document and places it on the clipboard. If the selection is empty the current line is copied.
If the selection is empty and the current line copied, an extra "MSDEVLineSelect" marker is added to the clipboard which is then used in Paste to paste the whole line before the current line.
public static CopyAllowLine ( ) : void
리턴 void

CopyRange() 공개 정적인 메소드

Copies the specified range of text to the clipboard.
public static CopyRange ( int start, int end ) : void
start int The zero-based character position in the document to start copying.
end int The zero-based character position (exclusive) in the document to stop copying.
리턴 void

Cut() 공개 정적인 메소드

Cuts the selected text from the document and places it on the clipboard.
public static Cut ( ) : void
리턴 void

DeleteTextByRange() 공개 정적인 메소드

Deletes the given range of text
public static DeleteTextByRange ( int start, int end ) : void
start int
end int
리턴 void

DocLineFromVisible() 공개 정적인 메소드

Returns the zero-based document line index from the specified display line index.
public static DocLineFromVisible ( int displayLine ) : int
displayLine int The zero-based display line index.
리턴 int

DropSelection() 공개 정적인 메소드

If there are multiple selections, removes the specified selection.
public static DropSelection ( int selection ) : void
selection int The zero-based selection index.
리턴 void

EndUndoAction() 공개 정적인 메소드

Mark the end of a set of operations that you want to undo all as one operation but that you have to generate as several operations. Alternatively, you can use these to mark a set of operations that you do not want to have combined with the preceding or following operations if they are undone.
public static EndUndoAction ( ) : void
리턴 void

ExecuteCmd() 공개 정적인 메소드

Performs the specified command
public static ExecuteCmd ( System.Windows.Forms.Command sciCommand ) : void
sciCommand System.Windows.Forms.Command The command to perform.
리턴 void

Exit() 공개 정적인 메소드

Leaves npp
public static Exit ( ) : void
리턴 void

FoldAll() 공개 정적인 메소드

Performs the specified fold action on the entire document.
When using FoldAction.Toggle the first fold header in the document is examined to decide whether to expand or contract.
public static FoldAll ( FoldAction action ) : void
action FoldAction One of the FoldAction enumeration values.
리턴 void

GetAblWordAtPosition() 공개 정적인 메소드

Returns the ABL word at the given position (read on left and right) (stops at points)
public static GetAblWordAtPosition ( int position ) : string
position int
리턴 string

GetBytes() 공개 정적인 메소드

Returns char array's bytes array with given encoding
public static GetBytes ( char text, int length, Encoding encoding, bool zeroTerminated ) : byte[]
text char
length int
encoding System.Text.Encoding
zeroTerminated bool
리턴 byte[]

GetBytes() 공개 정적인 메소드

Returns a string's bytes array with given encoding
public static GetBytes ( string text, Encoding encoding, bool zeroTerminated ) : byte[]
text string
encoding System.Text.Encoding
zeroTerminated bool
리턴 byte[]

GetCaretScreenLocation() 공개 정적인 메소드

Gets the current screen location of the caret.
public static GetCaretScreenLocation ( ) : Point
리턴 Point

GetColumn() 공개 정적인 메소드

Returns the column number of the specified document position, taking the width of tabs into account.
public static GetColumn ( int position ) : int
position int The zero-based document position to get the column for.
리턴 int

GetConfigDir() 공개 정적인 메소드

Returns the configuration directory path e.g. /plugins/config/{AssemblyProduct}
public static GetConfigDir ( ) : string
리턴 string

GetCurrentFileExtension() 공개 정적인 메소드

returns the current file's extension
public static GetCurrentFileExtension ( ) : string
리턴 string

GetCurrentFileFolder() 공개 정적인 메소드

Returns the current file folder (uses GetDirectoryName)
public static GetCurrentFileFolder ( ) : string
리턴 string

GetCurrentFileName() 공개 정적인 메소드

Returns the current file base name (uses GetFileName)
public static GetCurrentFileName ( ) : string
리턴 string

GetCurrentFilePath() 공개 정적인 메소드

Gets the path of the current document.
public static GetCurrentFilePath ( ) : string
리턴 string

GetEndStyled() 공개 정적인 메소드

Returns the last document position likely to be styled correctly.
public static GetEndStyled ( ) : int
리턴 int

GetFirstWordRightAfterPoint() 공개 정적인 메소드

returns the first keyword right after the point (reading from right to left) it is useful to get a table name when we enter a field, or a database name when we enter a table name, also, if you analyse DATABASE.TABLE.CURFIELD, if returns TABLE and not DATABASE!
public static GetFirstWordRightAfterPoint ( int curPos ) : string
curPos int
리턴 string

GetFocus() 공개 정적인 메소드

to be tested!!!!
public static GetFocus ( ) : bool
리턴 bool

GetIndentString() 공개 정적인 메소드

returns the indent value as a string, can be either a \t or a number of ' '
public static GetIndentString ( ) : string
리턴 string

GetIndicator() 공개 정적인 메소드

Returns an indicator object Range of indicator id to use is from 8=INDIC_CONTAINER .. to 31=INDIC_IME-1
public static GetIndicator ( int index ) : Indicator
index int
리턴 Indicator

GetKeyword() 공개 정적인 메소드

Gets the keyword at given position (reading only on the left of the position)
public static GetKeyword ( int curPos = -1 ) : string
curPos int
리턴 string

GetLine() 공개 정적인 메소드

Returns a Line object representing the current line
public static GetLine ( ) : Line
리턴 Line

GetLine() 공개 정적인 메소드

Returns a Line object representing the given line
public static GetLine ( int index ) : Line
index int
리턴 Line

GetMargin() 공개 정적인 메소드

Returns a margin object The margins are numbered 0 to 4. Using a margin number outside the valid range has no effect. By default, margin 0 is set to display line numbers, but is given a width of 0, so it is hidden. Margin 1 is set to display non-folding symbols and is given a width of 16 pixels, so it is visible. Margin 2 is set to display the folding symbols, but is given a width of 0, so it is hidden. Of course, you can set the margins to be whatever you wish.
public static GetMargin ( int index ) : Margin
index int
리턴 Margin

GetMarker() 공개 정적인 메소드

Returns a marker object There are 32 markers, numbered 0 to MARKER_MAX (31), and you can assign any combination of them to each line in the document Marker numbers 25 to 31 are used by Scintilla in folding margins Marker numbers 0 to 24 have no pre-defined function; you can use them
public static GetMarker ( int index ) : Marker
index int
리턴 Marker

GetNppDirectory() 공개 정적인 메소드

returns npp's folder path
public static GetNppDirectory ( ) : string
리턴 string

GetOpenedFiles() 공개 정적인 메소드

Gets the file path of each file currently opened
public static GetOpenedFiles ( ) : List
리턴 List

GetOpenedFilesPrimary() 공개 정적인 메소드

Gets the file path of each file currently opened in the primary view
public static GetOpenedFilesPrimary ( ) : List
리턴 List

GetOpenedFilesSecondary() 공개 정적인 메소드

Gets the file path of each file currently opened in the secondary view
public static GetOpenedFilesSecondary ( ) : List
리턴 List

GetPointXyFromPosition() 공개 정적인 메소드

returns the x,y point location of the character at the position given
public static GetPointXyFromPosition ( int position ) : Point
position int
리턴 Point

GetPosFromLineColumn() 공개 정적인 메소드

This message returns the position of a column on a line taking the width of tabs into account. It treats a multi-byte character as a single column. Column numbers, like lines start at 0.
public static GetPosFromLineColumn ( int line, int column ) : int
line int
column int
리턴 int

GetPositionFromMouseLocation() 공개 정적인 메소드

Self explaining
public static GetPositionFromMouseLocation ( ) : int
리턴 int

GetScintillaRectangle() 공개 정적인 메소드

returns a rectangle representing the location and size of the scintilla window
public static GetScintillaRectangle ( ) : Rectangle
리턴 System.Drawing.Rectangle

GetSelection() 공개 정적인 메소드

Returns a selection object
public static GetSelection ( int index ) : Selection
index int
리턴 Selection

GetSessionFiles() 공개 정적인 메소드

Gets the file path of each file in the session file, return the files separated by a new line
public static GetSessionFiles ( string sessionFilePath ) : string
sessionFilePath string
리턴 string

GetString() 공개 정적인 메소드

Get string from pointer
public static GetString ( IntPtr bytes, int length, Encoding encoding ) : string
bytes System.IntPtr
length int
encoding System.Text.Encoding
리턴 string

GetStyle() 공개 정적인 메소드

Returns a style object There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255). There are also some predefined numbered styles starting at 32.
public static GetStyle ( byte index ) : Style
index byte
리턴 _3PA.MainFeatures.Style

GetStyleAt() 공개 정적인 메소드

Gets the style of the specified document position.
public static GetStyleAt ( int position ) : int
position int The zero-based document position of the character to get the style for.
리턴 int

GetTag() 공개 정적인 메소드

Returns the capture group text of the most recent regular expression search.
public static GetTag ( int tagNumber ) : string
tagNumber int The capture group (1 through 9) to get the text for.
리턴 string

GetTextBetween() 공개 정적인 메소드

public static GetTextBetween ( Point point ) : string
point Point
리턴 string

GetTextByRange() 공개 정적인 메소드

Gets a range of text from the document.
public static GetTextByRange ( int start, int end ) : string
start int The zero-based starting character position of the range to get.
end int The zero-based ending character position of the range to get.
리턴 string

GetTextOnLeftOfPos() 공개 정적인 메소드

returns the text on the left of the position... it will always return empty string at minima
public static GetTextOnLeftOfPos ( int curPos, int maxLenght = KeywordMaxLength ) : string
curPos int
maxLenght int
리턴 string

GetTextOnRightOfPos() 공개 정적인 메소드

returns the text on the right of the position... it will always return empty string at minima
public static GetTextOnRightOfPos ( int curPos, int maxLenght = KeywordMaxLength ) : string
curPos int
maxLenght int
리턴 string

GetTextRange() 공개 정적인 메소드

Gets a range of text from the document.
public static GetTextRange ( int position, int length ) : string
position int The zero-based starting character position of the range to get.
length int The number of characters to get.
리턴 string

GoBackFromDefinition() 공개 정적인 메소드

When you use the GoToDefinition method, you stack points of your position before the jump, this method allows you to navigate back to where you were
public static GoBackFromDefinition ( ) : void
리턴 void

GoToLine() 공개 정적인 메소드

Move the caret and the view to the specified line (lines starts 0!)
public static GoToLine ( int line ) : void
line int
리턴 void

Goto() 공개 정적인 메소드

Switch to a document, can be already opended or not
public static Goto ( string document, int line = -1, int column = -1 ) : void
document string
line int
column int
리턴 void

Goto() 공개 정적인 메소드

Switch to a document, can be already opended or not, can decide to remember the current position to jump back to it
public static Goto ( string document, int position, int line, int column, bool saveHistoric ) : void
document string
position int
line int
column int
saveHistoric bool
리턴 void

GotoPos() 공개 정적인 메소드

Switch to a document, can be already opended or not
public static GotoPos ( string document, int position ) : void
document string
position int
리턴 void

GotoPosition() 공개 정적인 메소드

Navigates the caret to the document position specified.
Any selection is discarded.
public static GotoPosition ( int position ) : void
position int The zero-based document character position to navigate to.
리턴 void

GrabFocus() 공개 정적인 메소드

allows scintilla to grab focus
public static GrabFocus ( ) : void
리턴 void

HideLines() 공개 정적인 메소드

Hides the range of lines specified.
public static HideLines ( int lineStart, int lineEnd ) : void
lineStart int The zero-based index of the line range to start hiding.
lineEnd int The zero-based index of the line range to end hiding.
리턴 void

InsertText() 공개 정적인 메소드

Inserts text at the specified position.
No scrolling is performed.
/// less than zero and not equal to -1. -or- /// is greater than the document length. ///
public static InsertText ( int position, string text ) : void
position int /// The zero-based character position to insert the text. Specify -1 to use the current caret /// position. ///
text string The text to insert into the document.
리턴 void

IsCurrentFileHasExtension() 공개 정적인 메소드

Determines whether the current file has the specified extension (e.g. ".cs").

Note it is case insensitive.

public static IsCurrentFileHasExtension ( string extension ) : bool
extension string The extension.
리턴 bool

LineFromPosition() 공개 정적인 메소드

Returns the line that contains the document position specified.
public static LineFromPosition ( int position ) : int
position int The zero-based document character position.
리턴 int

LineScroll() 공개 정적인 메소드

Scrolls the display the number of lines and columns specified.
Negative values scroll in the opposite direction. A column is the width in pixels of a space character in the Style.Default style.
public static LineScroll ( int lines, int columns ) : void
lines int The number of lines to scroll.
columns int The number of columns to scroll.
리턴 void

LoadCurrentSession() 공개 정적인 메소드

public static LoadCurrentSession ( string file ) : void
file string
리턴 void

ModifyTextAroundCaret() 공개 정적인 메소드

Use this method to modify the text around the caret, it's good because :

- it's wrapped around beginundo/endundo which allows the user to CTRL+Z all the actions as one

- it handles the modification around ALL the carets -> good for multiselection
public static ModifyTextAroundCaret ( int offsetStart, int offsetEnd, string text ) : void
offsetStart int offset relative to the current carret position
offsetEnd int offset relative to the current carret position
text string
리턴 void

NewDocument() 공개 정적인 메소드

displays the input text into a new document
public static NewDocument ( string text ) : void
text string
리턴 void

OpenFile() 공개 정적인 메소드

Opens given file in notepad++
public static OpenFile ( string file ) : bool
file string
리턴 bool

Paste() 공개 정적인 메소드

Pastes the contents of the clipboard into the current selection.
public static Paste ( ) : void
리턴 void

PointXFromPosition() 공개 정적인 메소드

Returns the X display pixel location of the specified document position.
public static PointXFromPosition ( int pos ) : int
pos int The zero-based document character position.
리턴 int

PointYFromPosition() 공개 정적인 메소드

Returns the Y display pixel location of the specified document position.
public static PointYFromPosition ( int pos ) : int
pos int The zero-based document character position.
리턴 int

RebuildLinesInfo() 공개 정적인 메소드

Call this to rebuild the lines information from scratch
public static RebuildLinesInfo ( ) : void
리턴 void

ReplaceKeywordWrapped() 공개 정적인 메소드

Replaces the left part of the keyword found at (CurrentPosition + offset) by the keyword given (all wrapped in an undo action + handles multiselection)
public static ReplaceKeywordWrapped ( string keyword, int offset ) : void
keyword string
offset int offset relative to the current carret position
리턴 void

ReplaceSelection() 공개 정적인 메소드

Replaces the current selection with the specified text.
If there is not a current selection, the text will be inserted at the current caret position. Following the operation the caret is placed at the end of the inserted text and scrolled into view. Does nothing if string is null or empty?
public static ReplaceSelection ( string text ) : void
text string The text that should replace the current selection.
리턴 void

ReplaceTarget() 공개 정적인 메소드

Replaces the target defined by TargetStart and TargetEnd with the specified text.
The TargetStart and TargetEnd properties will be updated to the start and end positions of the replaced text. The recommended way to delete text in the document is to set the target range to be removed and replace the target with an empty string.
public static ReplaceTarget ( string text ) : int
text string The text that will replace the current target.
리턴 int

ReplaceTargetRe() 공개 정적인 메소드

Replaces the target text defined by TargetStart and TargetEnd with the specified value after first substituting "\1" through "\9" macros in the text with the most recent regular expression capture groups.
The "\0" macro will be substituted by the entire matched text from the most recent search. The TargetStart and TargetEnd properties will be updated to the start and end positions of the replaced text.
public static ReplaceTargetRe ( string text ) : int
text string /// The text containing "\n" macros that will be substituted with the most recent regular expression /// capture groups and then replace the current target. ///
리턴 int

RotateSelection() 공개 정적인 메소드

Makes the next selection the main selection.
public static RotateSelection ( ) : void
리턴 void

RunCommand() 공개 정적인 메소드

Allows to execute one of Npp's command
public static RunCommand ( NppMenuCmd cmd ) : void
cmd NppMenuCmd
리턴 void

SaveCurrentDocument() 공개 정적인 메소드

Saves the current document.
public static SaveCurrentDocument ( ) : void
리턴 void

SaveCurrentSession() 공개 정적인 메소드

public static SaveCurrentSession ( string file ) : void
file string
리턴 void

SaveSession() 공개 정적인 메소드

Saves the session into a file
public static SaveSession ( string sessionFilePath ) : bool
sessionFilePath string
리턴 bool

ScrollCaret() 공개 정적인 메소드

Scrolls the current position into view, if it is not already visible.
public static ScrollCaret ( ) : void
리턴 void

ScrollRange() 공개 정적인 메소드

Scrolls the specified range into view.
This may be used to make a search match visible.
public static ScrollRange ( int start, int end ) : void
start int The zero-based document start position to scroll to.
end int /// The zero-based document end position to scroll to if doing so does not cause the /// position to scroll out of view. ///
리턴 void

SearchInTarget() 공개 정적인 메소드

Searches for the first occurrence of the specified text in the target defined by TargetStart and TargetEnd.
If successful, the TargetStart and TargetEnd properties will be updated to the start and end positions of the matched text. Searching can be performed in reverse using a TargetStart greater than the TargetEnd.
public static SearchInTarget ( string text ) : int
text string /// The text to search for. The interpretation of the text (i.e. whether it is a regular expression) is /// defined by the SearchFlags property. ///
리턴 int

SelectAll() 공개 정적인 메소드

Selects all the text in the document.
The current position is not scrolled into view.
public static SelectAll ( ) : void
리턴 void

SetAdditionalSelectionColor() 공개 정적인 메소드

Sets a global override to the additional selections background + foreground color.
public static SetAdditionalSelectionColor ( bool use, Color bg, Color fg ) : void
use bool
bg Color
fg Color
리턴 void

SetCommand() 공개 정적인 메소드

Creates entry in the FuncItems list, which list the menu entry displayed in Npp's plugin menu
public static SetCommand ( int index, string commandName, System.Action functionPointer, ShortcutKey shortcut = newShortcutKey(), bool checkOnInit = false ) : void
index int
commandName string
functionPointer System.Action
shortcut _3PA.Interop.ShortcutKey
checkOnInit bool
리턴 void

SetEmptySelection() 공개 정적인 메소드

Removes any selection and places the caret at the specified position.
The caret is not scrolled into view.
public static SetEmptySelection ( int pos ) : void
pos int The zero-based document position to place the caret at.
리턴 void

SetFoldMarginColors() 공개 정적인 메소드

allow changing the colour of the fold margin and fold margin highlight
public static SetFoldMarginColors ( bool use, Color bgColor, Color fgColor ) : void
use bool
bgColor Color
fgColor Color
리턴 void

SetFoldMarginMarkersColor() 공개 정적인 메소드

allow changing the colour of the fold margin and fold margin highlight
public static SetFoldMarginMarkersColor ( Color bgColor, Color fgColor, Color activeColor ) : void
bgColor Color
fgColor Color
activeColor Color
리턴 void

SetHotSpotActiveColor() 공개 정적인 메소드

While the cursor hovers over text in a style with the hotspot attribute set, the default colouring can be modified
public static SetHotSpotActiveColor ( bool use, Color fg, Color bg ) : void
use bool
fg Color
bg Color
리턴 void

SetIndentGuideColor() 공개 정적인 메소드

sets the fore/background color of the IndentGuide, overriding the lexer's
public static SetIndentGuideColor ( Color bg, Color fg ) : void
bg Color
fg Color
리턴 void

SetSel() 공개 정적인 메소드

Sets the current carret position + the current anchor position to the same position
public static SetSel ( int pos ) : void
pos int
리턴 void

SetSel() 공개 정적인 메소드

Sets the anchor and current position.
A negative value for currentPos signifies the end of the document. A negative value for anchorPos signifies no selection (set the anchorPos to the same as the currentPos). The current position is scrolled into view following this operation.
public static SetSel ( int anchorPos, int currentPos ) : void
anchorPos int The zero-based document position to start the selection.
currentPos int The zero-based document position to end the selection.
리턴 void

SetSelection() 공개 정적인 메소드

Set a single selection from anchor to caret as the ONLY selection.
public static SetSelection ( int caret ) : void
caret int The zero-based document position to end the selection.
리턴 void

SetSelection() 공개 정적인 메소드

Set a single selection from anchor to caret as the ONLY selection.
public static SetSelection ( int caret, int anchor ) : void
caret int The zero-based document position to end the selection.
anchor int The zero-based document position to start the selection.
리턴 void

SetSelectionColor() 공개 정적인 메소드

Sets a global override to the selection background + foreground color.
public static SetSelectionColor ( bool use, Color bg, Color fg ) : void
use bool
bg Color
fg Color
리턴 void

SetStatusbarLabel() 공개 정적인 메소드

Sets the label in the status of npp (bottom right)
WARNING : THIS METHOD IS HIGHLY UNSTABLE, USE ONLY FOR DEBUG!
public static SetStatusbarLabel ( string labelText ) : string
labelText string
리턴 string

SetStyling() 공개 정적인 메소드

Styles the specified length of characters.
The styling position is advanced by length after each call allowing multiple calls to SetStyling for a single call to StartStyling.
/// or is less than zero. -or- /// The sum of a preceeding call to StartStyling or and is greater /// than the document length. -or- /// is greater than or equal to the number of style definitions. ///
public static SetStyling ( int length, int style ) : void
length int The number of characters to style.
style int The Style definition index to assign each character.
리턴 void

SetTargetRange() 공개 정적인 메소드

Sets the TargetStart and TargetEnd properties in a single call.
public static SetTargetRange ( int start, int end ) : void
start int The zero-based character position within the document to start a search or replace operation.
end int The zero-based character position within the document to end a search or replace operation.
리턴 void

SetTextByRange() 공개 정적인 메소드

Sets the text of a specific range, can and must be used to delete text from range
public static SetTextByRange ( int start, int end, string text ) : void
start int
end int
text string
리턴 void

SetToolbarImage() 공개 정적인 메소드

Helper to add a clickable icon in the toolbar
public static SetToolbarImage ( Bitmap image, int pluginId ) : void
image System.Drawing.Bitmap
pluginId int
리턴 void

SetWhiteSpaceColor() 공개 정적인 메소드

sets the fore/background color of the whitespaces, overriding the lexer's
public static SetWhiteSpaceColor ( bool use, Color bg, Color fg ) : void
use bool
bg Color
fg Color
리턴 void

ShowInactiveTopmost() 공개 정적인 메소드

public static ShowInactiveTopmost ( Form frm ) : void
frm System.Windows.Forms.Form
리턴 void

ShowLines() 공개 정적인 메소드

Shows the range of lines specified.
public static ShowLines ( int lineStart, int lineEnd ) : void
lineStart int The zero-based index of the line range to start showing.
lineEnd int The zero-based index of the line range to end showing.
리턴 void

StartBytePosOfLine() 공개 정적인 메소드

Returns the !! BYTE !! position of the start of given line Don't use THIS unless you know what you are doing with it!!!
public static StartBytePosOfLine ( int line ) : int
line int
리턴 int

StartRecordMacro() 공개 정적인 메소드

public static StartRecordMacro ( ) : IntPtr
리턴 System.IntPtr

StartStyling() 공개 정적인 메소드

Prepares for styling by setting the styling position to start at.
After preparing the document for styling, use successive calls to SetStyling to style the document.
public static StartStyling ( int position ) : void
position int The zero-based character position in the document to start styling.
리턴 void

StyleClearAll() 공개 정적인 메소드

Resets all style properties to those currently configured for the Style.Default style.
public static StyleClearAll ( ) : void
리턴 void

StyleResetDefault() 공개 정적인 메소드

Resets the Style.Default style to its initial state.
public static StyleResetDefault ( ) : void
리턴 void

StyleTextEx() 공개 정적인 메소드

TODO: UNTESTED set the style of a text from startPos to startPos + styleArray.Length, the styleArray is a array of bytes, each byte is the style number to the corresponding text byte
public static StyleTextEx ( int startPos, byte styleArray ) : void
startPos int
styleArray byte
리턴 void

SwapMainAnchorCaret() 공개 정적인 메소드

Moves the caret to the opposite end of the main selection.
public static SwapMainAnchorCaret ( ) : void
리턴 void

SwitchToDocument() 공개 정적인 메소드

Switch to given document
public static SwitchToDocument ( string doc ) : void
doc string
리턴 void

TargetFromSelection() 공개 정적인 메소드

Sets the TargetStart and TargetEnd to the start and end positions of the selection.
public static TargetFromSelection ( ) : void
리턴 void

TargetWholeDocument() 공개 정적인 메소드

Sets the TargetStart and TargetEnd to the start and end positions of the document.
public static TargetWholeDocument ( ) : void
리턴 void

TextHeight() 공개 정적인 메소드

Retrieve the height of a particular line of text in pixels.
public static TextHeight ( int line ) : int
line int
리턴 int

TextWidth() 공개 정적인 메소드

Measures the width in pixels of the specified string when rendered in the specified style.
public static TextWidth ( int style, string text ) : int
style int The index of the Style to use when rendering the text to measure.
text string The text to measure.
리턴 int

Undo() 공개 정적인 메소드

Undo previous action
public static Undo ( ) : void
리턴 void

UpdateLinesInfo() 공개 정적인 메소드

Call this on SCN_MODIFIED event from scintilla to update the info on lines
public static UpdateLinesInfo ( SCNotification scn, bool isInsertion ) : void
scn _3PA.Interop.SCNotification
isInsertion bool
리턴 void

UpdateScintilla() 공개 정적인 메소드

Updates the current scintilla handle for Npp's functions Called when the user changes the current document
public static UpdateScintilla ( bool reverse = false ) : void
reverse bool
리턴 void

ZoomIn() 공개 정적인 메소드

Increases the zoom factor by 1 until it reaches 20 points.
public static ZoomIn ( ) : void
리턴 void

ZoomOut() 공개 정적인 메소드

Decreases the zoom factor by 1 until it reaches -10 points.
public static ZoomOut ( ) : void
리턴 void