C# 클래스 phdesign.NppToolBucket.PluginCore.Editor

상속: PluginBase
파일 보기 프로젝트 열기: phdesign/NppToolBucket 1 사용 예제들

공개 메소드들

메소드 설명
AddBookmark ( int lineNumber ) : void

Add a bookmark at a specific line.

AddFindMark ( int pos, int length ) : void

Marks a range of text.

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.

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.

EnsureRangeVisible ( int start, int end ) : void

Make a range visible by scrolling to the last line of the range. A line may be hidden because more than one of its parent lines is contracted. Both these message travels up the fold hierarchy, expanding any contracted folds until they reach the top level. The line will then be visible.

FindInTarget ( string findText, int startPosition, int endPosition ) : int

This searches for the first occurrence of a text string in the target defined by startPosition and endPosition. The text string is not zero terminated; the size is set by length. The search is modified by the search flags set by SCI_SETSEARCHFLAGS. If the search succeeds, the target is set to the found text and the return value is the position of the start of the matching text. If the search fails, the result is -1.

GetActive ( ) : Editor
GetCharAt ( int pos ) : char

This returns the character at pos in the document or 0 if pos is negative or past the end of the document.

GetCurrentLineNumber ( ) : int

Get the line number that the cursor is on.

GetDocumentLength ( ) : int

Returns the length of the document in bytes.

GetDocumentText ( ) : string

Gets the entire document text.

GetIndent ( ) : int

Gets the size of indentation in terms of the width of a space in STYLE_DEFAULT. If you set a width of 0, the indent size is the same as the tab size. There are no limits on indent sizes, but values less than 0 or large values may have undesirable effects.

GetLineCount ( ) : int

This returns the number of lines in the document. An empty document contains 1 line. A document holding only an end of line sequence has 2 lines.

GetLineIndentPosition ( int line ) : int

This returns the position at the end of indentation of a line.

GetLineIndentation ( int line ) : int

Returns the amount of indentation on a line. The indentation is measured in character columns, which correspond to the width of space characters.

GetSelectedOrAllText ( ) : string

Gets the selected text or if nothing is selected, gets whole document text.

GetSelectedText ( ) : string

Returns the text currently selected (highlighted).

GetSelectionLength ( ) : int

Size in bytes of the selection.

GetSelectionRange ( ) : Sci_CharacterRange

Returns the start and end of the selection without regard to which end is the current position and which is the anchor. SCI_GETSELECTIONSTART returns the smaller of the current position or the anchor position.

GetTabWidth ( ) : int

Gets the size of a tab as a multiple of the size of a space character in STYLE_DEFAULT. The default tab width is 8 characters. There are no limits on tab sizes, but values less than 1 or large values may have undesirable effects.

GetTargetRange ( ) : Sci_CharacterRange

Returns the current target start and end positions from a previous operation.

GetTextByRange ( int start, int end ) : string

Returns the text between the positions start and end. If end is -1, text is returned to the end of the document. The text is 0 terminated, so you must supply a buffer that is at least 1 character longer than the number of characters you wish to read. The return value is the length of the returned text not including the terminating 0.

GetTextByRange ( int start, int end, int bufCapacity ) : string

Returns the text between the positions start and end. If end is -1, text is returned to the end of the document. The text is 0 terminated, so you must supply a buffer that is at least 1 character longer than the number of characters you wish to read. The return value is the length of the returned text not including the terminating 0.

GetUseTabs ( ) : int

Determines whether indentation should be created out of a mixture of tabs and spaces or be based purely on spaces. Set useTabs to false (0) to create all tabs and indents out of spaces. The default is true. You can use SCI_GETCOLUMN to get the column of a position taking the width of a tab into account.

IsBookmarkPresent ( int lineNumber ) : bool

Is there a bookmark set on a line.

IsUnicode ( ) : bool

Returns true if the current document is displaying in unicode format or false for ANSI. Note that all strings marshaled to and from Scintilla come in ANSI format so need to be converted if using Unicode.

LineFromPosition ( int pos ) : int

Returns the line that contains the position pos in the document. The return value is 0 if pos <= 0. The return value is the last line if pos is beyond the end of the document.

PositionAfter ( int pos ) : int

return the position after another position in the document taking into account the current code page. The maximum is the last position in the document. If called with a position within a multi byte character will return the position of the end of that character.

PositionFromLine ( int line ) : int

This returns the document position that corresponds with the start of the line. If line is negative, the position of the line holding the start of the selection is returned. If line is greater than the lines in the document, the return value is -1. If line is equal to the number of lines in the document (i.e. 1 line past the last line), the return value is the end of the document.

RemoveAllBookmarks ( ) : void

Remove all bookmarks from the document.

RemoveFindMarks ( ) : void

Remove all 'find' marks.

ReplaceText ( int start, int end, string text ) : int

Replaces a range of text with new text. Note that the recommended way to delete text in the document is to set the target to the text to be removed, and to perform a replace target with an empty string.

ReplaceText ( string text, bool useRegularExpression ) : int

Replaces the current selected target range of text.

SetDocumentText ( string text ) : void

Sets the text for the entire document (replacing any existing text).

SetIndent ( int indentSize ) : void

Sets the size of indentation in terms of the width of a space in STYLE_DEFAULT. If you set a width of 0, the indent size is the same as the tab size. There are no limits on indent sizes, but values less than 0 or large values may have undesirable effects.

SetSearchFlags ( bool matchWholeWord, bool matchCase, bool useRegularExpression, bool usePosixRegularExpressions ) : void
SetSelectedText ( string text ) : void

The currently selected text is replaced with text. If no text is selected the text is inserted at current cursor postion.

SetSelection ( int start, int end ) : void

Sets both the anchor and the current position. If end is negative, it means the end of the document. If start is negative, it means remove any selection (i.e. set the start to the same position as end). The caret is scrolled into view after this operation.

SetTabWidth ( int tabSize ) : void

Sets the size of a tab as a multiple of the size of a space character in STYLE_DEFAULT. The default tab width is 8 characters. There are no limits on tab sizes, but values less than 1 or large values may have undesirable effects.

SetTargetRange ( int start, int end ) : void

Sets the start and end positions for an upcoming operation.

SetUseTabs ( bool useTabs ) : void

Determines whether indentation should be created out of a mixture of tabs and spaces or be based purely on spaces. Set useTabs to false (0) to create all tabs and indents out of spaces. The default is true. You can use SCI_GETCOLUMN to get the column of a position taking the width of a tab into account.

비공개 메소드들

메소드 설명
Call ( SciMsg msg ) : int
Call ( SciMsg msg, int wParam ) : int
Call ( SciMsg msg, int wParam, IntPtr lParam ) : int
Call ( SciMsg msg, int wParam, StringBuilder lParam ) : int
Call ( SciMsg msg, int wParam, int lParam ) : int
Call ( SciMsg msg, int wParam, string lParam ) : int
Editor ( IntPtr activeScintilla ) : System

메소드 상세

AddBookmark() 공개 메소드

Add a bookmark at a specific line.
public AddBookmark ( int lineNumber ) : void
lineNumber int The line number to add a bookmark to.
리턴 void

AddFindMark() 공개 메소드

Marks a range of text.
public AddFindMark ( int pos, int length ) : void
pos int
length int
리턴 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 BeginUndoAction ( ) : void
리턴 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 EndUndoAction ( ) : void
리턴 void

EnsureRangeVisible() 공개 메소드

Make a range visible by scrolling to the last line of the range. A line may be hidden because more than one of its parent lines is contracted. Both these message travels up the fold hierarchy, expanding any contracted folds until they reach the top level. The line will then be visible.
public EnsureRangeVisible ( int start, int end ) : void
start int
end int
리턴 void

FindInTarget() 공개 메소드

This searches for the first occurrence of a text string in the target defined by startPosition and endPosition. The text string is not zero terminated; the size is set by length. The search is modified by the search flags set by SCI_SETSEARCHFLAGS. If the search succeeds, the target is set to the found text and the return value is the position of the start of the matching text. If the search fails, the result is -1.
public FindInTarget ( string findText, int startPosition, int endPosition ) : int
findText string String to search for.
startPosition int Where to start searching from.
endPosition int Where to stop searching.
리턴 int

GetActive() 공개 정적인 메소드

public static GetActive ( ) : Editor
리턴 Editor

GetCharAt() 공개 메소드

This returns the character at pos in the document or 0 if pos is negative or past the end of the document.
public GetCharAt ( int pos ) : char
pos int
리턴 char

GetCurrentLineNumber() 공개 메소드

Get the line number that the cursor is on.
public GetCurrentLineNumber ( ) : int
리턴 int

GetDocumentLength() 공개 메소드

Returns the length of the document in bytes.
public GetDocumentLength ( ) : int
리턴 int

GetDocumentText() 공개 메소드

Gets the entire document text.
public GetDocumentText ( ) : string
리턴 string

GetIndent() 공개 메소드

Gets the size of indentation in terms of the width of a space in STYLE_DEFAULT. If you set a width of 0, the indent size is the same as the tab size. There are no limits on indent sizes, but values less than 0 or large values may have undesirable effects.
public GetIndent ( ) : int
리턴 int

GetLineCount() 공개 메소드

This returns the number of lines in the document. An empty document contains 1 line. A document holding only an end of line sequence has 2 lines.
public GetLineCount ( ) : int
리턴 int

GetLineIndentPosition() 공개 메소드

This returns the position at the end of indentation of a line.
public GetLineIndentPosition ( int line ) : int
line int
리턴 int

GetLineIndentation() 공개 메소드

Returns the amount of indentation on a line. The indentation is measured in character columns, which correspond to the width of space characters.
public GetLineIndentation ( int line ) : int
line int
리턴 int

GetSelectedOrAllText() 공개 메소드

Gets the selected text or if nothing is selected, gets whole document text.
public GetSelectedOrAllText ( ) : string
리턴 string

GetSelectedText() 공개 메소드

Returns the text currently selected (highlighted).
public GetSelectedText ( ) : string
리턴 string

GetSelectionLength() 공개 메소드

Size in bytes of the selection.
public GetSelectionLength ( ) : int
리턴 int

GetSelectionRange() 공개 메소드

Returns the start and end of the selection without regard to which end is the current position and which is the anchor. SCI_GETSELECTIONSTART returns the smaller of the current position or the anchor position.
public GetSelectionRange ( ) : Sci_CharacterRange
리턴 Sci_CharacterRange

GetTabWidth() 공개 메소드

Gets the size of a tab as a multiple of the size of a space character in STYLE_DEFAULT. The default tab width is 8 characters. There are no limits on tab sizes, but values less than 1 or large values may have undesirable effects.
public GetTabWidth ( ) : int
리턴 int

GetTargetRange() 공개 메소드

Returns the current target start and end positions from a previous operation.
public GetTargetRange ( ) : Sci_CharacterRange
리턴 Sci_CharacterRange

GetTextByRange() 공개 메소드

Returns the text between the positions start and end. If end is -1, text is returned to the end of the document. The text is 0 terminated, so you must supply a buffer that is at least 1 character longer than the number of characters you wish to read. The return value is the length of the returned text not including the terminating 0.
public GetTextByRange ( int start, int end ) : string
start int
end int
리턴 string

GetTextByRange() 공개 메소드

Returns the text between the positions start and end. If end is -1, text is returned to the end of the document. The text is 0 terminated, so you must supply a buffer that is at least 1 character longer than the number of characters you wish to read. The return value is the length of the returned text not including the terminating 0.
public GetTextByRange ( int start, int end, int bufCapacity ) : string
start int
end int
bufCapacity int
리턴 string

GetUseTabs() 공개 메소드

Determines whether indentation should be created out of a mixture of tabs and spaces or be based purely on spaces. Set useTabs to false (0) to create all tabs and indents out of spaces. The default is true. You can use SCI_GETCOLUMN to get the column of a position taking the width of a tab into account.
public GetUseTabs ( ) : int
리턴 int

IsBookmarkPresent() 공개 메소드

Is there a bookmark set on a line.
public IsBookmarkPresent ( int lineNumber ) : bool
lineNumber int The line number to check.
리턴 bool

IsUnicode() 공개 메소드

Returns true if the current document is displaying in unicode format or false for ANSI. Note that all strings marshaled to and from Scintilla come in ANSI format so need to be converted if using Unicode.
public IsUnicode ( ) : bool
리턴 bool

LineFromPosition() 공개 메소드

Returns the line that contains the position pos in the document. The return value is 0 if pos <= 0. The return value is the last line if pos is beyond the end of the document.
public LineFromPosition ( int pos ) : int
pos int
리턴 int

PositionAfter() 공개 메소드

return the position after another position in the document taking into account the current code page. The maximum is the last position in the document. If called with a position within a multi byte character will return the position of the end of that character.
public PositionAfter ( int pos ) : int
pos int
리턴 int

PositionFromLine() 공개 메소드

This returns the document position that corresponds with the start of the line. If line is negative, the position of the line holding the start of the selection is returned. If line is greater than the lines in the document, the return value is -1. If line is equal to the number of lines in the document (i.e. 1 line past the last line), the return value is the end of the document.
public PositionFromLine ( int line ) : int
line int
리턴 int

RemoveAllBookmarks() 공개 메소드

Remove all bookmarks from the document.
public RemoveAllBookmarks ( ) : void
리턴 void

RemoveFindMarks() 공개 메소드

Remove all 'find' marks.
public RemoveFindMarks ( ) : void
리턴 void

ReplaceText() 공개 메소드

Replaces a range of text with new text. Note that the recommended way to delete text in the document is to set the target to the text to be removed, and to perform a replace target with an empty string.
public ReplaceText ( int start, int end, string text ) : int
start int
end int
text string
리턴 int

ReplaceText() 공개 메소드

Replaces the current selected target range of text.
public ReplaceText ( string text, bool useRegularExpression ) : int
text string The replacement text.
useRegularExpression bool If true, uses a regular expressions replacement.
리턴 int

SetDocumentText() 공개 메소드

Sets the text for the entire document (replacing any existing text).
public SetDocumentText ( string text ) : void
text string The document text to set.
리턴 void

SetIndent() 공개 메소드

Sets the size of indentation in terms of the width of a space in STYLE_DEFAULT. If you set a width of 0, the indent size is the same as the tab size. There are no limits on indent sizes, but values less than 0 or large values may have undesirable effects.
public SetIndent ( int indentSize ) : void
indentSize int
리턴 void

SetSearchFlags() 공개 메소드

public SetSearchFlags ( bool matchWholeWord, bool matchCase, bool useRegularExpression, bool usePosixRegularExpressions ) : void
matchWholeWord bool
matchCase bool
useRegularExpression bool
usePosixRegularExpressions bool
리턴 void

SetSelectedText() 공개 메소드

The currently selected text is replaced with text. If no text is selected the text is inserted at current cursor postion.
public SetSelectedText ( string text ) : void
text string The document text to set.
리턴 void

SetSelection() 공개 메소드

Sets both the anchor and the current position. If end is negative, it means the end of the document. If start is negative, it means remove any selection (i.e. set the start to the same position as end). The caret is scrolled into view after this operation.
public SetSelection ( int start, int end ) : void
start int The selection start (anchor) position.
end int The selection end (current) position.
리턴 void

SetTabWidth() 공개 메소드

Sets the size of a tab as a multiple of the size of a space character in STYLE_DEFAULT. The default tab width is 8 characters. There are no limits on tab sizes, but values less than 1 or large values may have undesirable effects.
public SetTabWidth ( int tabSize ) : void
tabSize int
리턴 void

SetTargetRange() 공개 메소드

Sets the start and end positions for an upcoming operation.
public SetTargetRange ( int start, int end ) : void
start int
end int
리턴 void

SetUseTabs() 공개 메소드

Determines whether indentation should be created out of a mixture of tabs and spaces or be based purely on spaces. Set useTabs to false (0) to create all tabs and indents out of spaces. The default is true. You can use SCI_GETCOLUMN to get the column of a position taking the width of a tab into account.
public SetUseTabs ( bool useTabs ) : void
useTabs bool
리턴 void