C# Класс _3PA.Npp

This class contains very generic wrappers for basic Notepad++ functionality.
Показать файл Открыть проект Примеры использования класса

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