C# 클래스 NppSharp.NppScript

Base class for all script objects. Any objects that wish to have their public methods made available as commands must inherit from this class.
파일 보기 프로젝트 열기: cmrazek/NppSharp

공개 메소드들

메소드 설명
Append ( string text ) : void

Appends text to the end of the document without affecting the selection.

CancelAutoCompletion ( ) : void

Cancels any active auto-completion.

Clear ( ) : void

Deletes the selected text.

ClearAll ( ) : void

Clears all text out of the document.

Copy ( ) : void

Copies the selected text to the clipboard.

Copy ( TextLocation start, TextLocation end ) : void

Copies the specified text range into the clipboard.

Copy ( TextLocation start, int numChars ) : void

Copies the specified text range into the clipboard.

Copy ( string text ) : void

Copies the provided string into the clipboard.

CopyAllowLine ( ) : void

Copies the selected text to the clipboard. If no text is selected, the current line is copied instead.

Cut ( ) : void

Cuts the selected text to the clipboard.

DockWindow ( IWin32Window window, string title, DockWindowAlignment alignment, int id ) : IDockWindow

Creates a docked window.

This window will not be restored the next time Notepad++ starts. The plugin must recreate the window during the 'Ready' event, if it wishes to have the window visible again.

Notepad++ will use the ID to remember the state for this docked window between sessions. If another docked window with the same ID had been opened previously with a different alignment, or the user had dragged the window to another side of the screen, then the docked window will appear in the previous location rather than the one specified here.

FindColumn ( int line, int column ) : TextLocation

Gets the position that corresponds to a line and column.

FocusEditor ( ) : void

Sets the focus to the current editor window.

GetActiveFileIndex ( EditorView view ) : int

Gets the current document index in the specified view.

GetDockWindow ( int id ) : IDockWindow

Gets the dock window object for the specified ID.

GetFileNames ( EditorView view ) : IEnumerable

Gets a list of open file names in the specified view.

To get a list of all open file names in both views, you can use the 'FileNames' property.

GetLanguageName ( int langId ) : string

Gets the name of a language, given the ID.

GetLineEndPos ( int line ) : TextLocation

Gets the ending position of the specified line, before any line-end characters.

GetLineLength ( int line ) : int

Gets the length of the specified line (excluding line-end characters).

GetLineStartPos ( int line ) : TextLocation

Gets the starting position of the specified line.

GetLineText ( int line ) : string

Gets the text for the specified line.

GetLineText ( int line, bool includeLineEndChars ) : string

Gets the text for the specified line, optionally including line-end characters.

GetText ( TextLocation start, TextLocation end ) : string

Gets the text for the specified range.

GetText ( TextLocation start, int numChars ) : string

Gets the text for the specified range.

GetWordEndPos ( TextLocation pos, bool onlyWordChars ) : TextLocation

Gets the position at the end of the current word.

GetWordStartPos ( TextLocation pos, bool onlyWordChars ) : TextLocation

Gets the position at the start of the current word.

GoTo ( TextLocation pos ) : void

Goes to the specified position and ensures it is visible.

GoToLine ( int line ) : void

Goes to the specified line and ensures it is visible.

Insert ( string text ) : void

Inserts text over the current selection. The caret is placed after the inserted text and scrolled into view.

LaunchFindInFiles ( string dir, string filters ) : void

Launches the 'Find in Files' dialog.

MenuCommand ( MenuCommand command ) : void

Triggers a menu item command.

MenuCommand ( int commandId ) : void

Triggers a menu item command.

MoveCaretInsideView ( ) : void

If the caret is outside the current view, it is moved to the nearest visible line. Any selection is lost.

MoveSelectedLinesDown ( ) : void

Moves the selected lines down one line, shifting the line below the selection.

MoveSelectedLinesUp ( ) : void

Moves the selected lines up one line, shifting the line above the selection.

OpenFile ( string fileName ) : bool

Opens a new file. If the file is already open, it will be made active.

Paste ( ) : void

Pastes the clipboard text over the selection.

PointToPos ( Point pt ) : TextLocation

Finds the position closest to a point on the screen.

PointToPosClose ( Point pt, TextLocation &location ) : bool

Finds the position closest to a point on the screen.

PosToPoint ( TextLocation pos ) : Point

Returns the x and y display location of the position.

RefreshCustomLexers ( ) : void

Refreshes the word-styles and folding on documents that use a custom lexer provided via NppSharp.

This function is useful if your lexers providing highlighting that can change, and need to be refreshed at certain events.

ReloadFile ( bool withAlert ) : void

Reloads the current file.

ReloadFile ( string fileName, bool withAlert ) : void

Reloads a file given the file name. If the file is not already open, then this has no effect.

SaveAllFiles ( ) : bool

Saves all open documents.

SaveFile ( ) : bool

Saves the current document.

SaveFileAs ( string fileName ) : bool

Saves the current document to another file name.

SaveFileCopyAs ( string fileName ) : bool

Saves a copy of the current document to another file name.

SelectAll ( ) : void

Selects all text in the document. (The caret is not scrolled into view)

SetActiveFileIndex ( EditorView view, int index ) : void

Switches to the file in the specified view.

SetEmptySelection ( TextLocation pos ) : void

Removes the selection and sets the caret at pos. (The caret is not scrolled into view)

SetSelection ( TextLocation anchorPos, TextLocation currentPos ) : void

Sets the selection range. (The caret is scrolled into view)

ShowAutoCompletion ( int lengthEntered, IEnumerable list ) : void

Shows the AutoCompletion list.

ShowAutoCompletion ( int lengthEntered, IEnumerable list, bool ignoreCase ) : void

Shows the AutoCompletion list.

ShowError ( Exception ex ) : void

Displays an error message caused by an exception.

ShowError ( Exception ex, string message ) : void

Displays an error message caused by an exception, with additional text.

ShowError ( string message ) : void

Displays an error message.

SwitchToFile ( string fileName ) : bool

Switches to a file given the file name.

보호된 메소드들

메소드 설명
OnLoad ( ) : void

Called after the object has been created and initialized, but before the Notepad++ Ready notification.

비공개 메소드들

메소드 설명
InitEvents ( ) : void
OnCharAdded ( object sender, CharAddedEventArgs e ) : void
OnDoubleClick ( object sender, DoubleClickEventArgs e ) : void
OnFileActivated ( object sender, FileEventArgs e ) : void
OnFileClosed ( object sender, FileEventArgs e ) : void
OnFileClosing ( object sender, FileEventArgs e ) : void
OnFileLoadFailed ( object sender, EventArgs e ) : void
OnFileLoading ( object sender, EventArgs e ) : void
OnFileOpened ( object sender, FileEventArgs e ) : void
OnFileOpening ( object sender, FileEventArgs e ) : void
OnFileOrderChanged ( object sender, FileEventArgs e ) : void
OnFileSaved ( object sender, FileEventArgs e ) : void
OnFileSaving ( object sender, FileEventArgs e ) : void
OnLanguageChanged ( object sender, LanguageTypeEventArgs e ) : void
OnModification ( object sender, ModifiedEventArgs e ) : void
OnReady ( object sender, EventArgs e ) : void
OnShutdown ( object sender, EventArgs e ) : void
OnStyleUpdate ( object sender, FileEventArgs e ) : void

메소드 상세

Append() 공개 메소드

Appends text to the end of the document without affecting the selection.
public Append ( string text ) : void
text string The text to be appended.
리턴 void

CancelAutoCompletion() 공개 메소드

Cancels any active auto-completion.
public CancelAutoCompletion ( ) : void
리턴 void

Clear() 공개 메소드

Deletes the selected text.
public Clear ( ) : void
리턴 void

ClearAll() 공개 메소드

Clears all text out of the document.
public ClearAll ( ) : void
리턴 void

Copy() 공개 메소드

Copies the selected text to the clipboard.
public Copy ( ) : void
리턴 void

Copy() 공개 메소드

Copies the specified text range into the clipboard.
public Copy ( TextLocation start, TextLocation end ) : void
start TextLocation The starting position.
end TextLocation The ending position (exclusive).
리턴 void

Copy() 공개 메소드

Copies the specified text range into the clipboard.
public Copy ( TextLocation start, int numChars ) : void
start TextLocation The starting position.
numChars int The number of characters to be copied.
리턴 void

Copy() 공개 메소드

Copies the provided string into the clipboard.
public Copy ( string text ) : void
text string The text to be placed into to the clipboard.
리턴 void

CopyAllowLine() 공개 메소드

Copies the selected text to the clipboard. If no text is selected, the current line is copied instead.
public CopyAllowLine ( ) : void
리턴 void

Cut() 공개 메소드

Cuts the selected text to the clipboard.
public Cut ( ) : void
리턴 void

DockWindow() 공개 메소드

Creates a docked window.

This window will not be restored the next time Notepad++ starts. The plugin must recreate the window during the 'Ready' event, if it wishes to have the window visible again.

Notepad++ will use the ID to remember the state for this docked window between sessions. If another docked window with the same ID had been opened previously with a different alignment, or the user had dragged the window to another side of the screen, then the docked window will appear in the previous location rather than the one specified here.

public DockWindow ( IWin32Window window, string title, DockWindowAlignment alignment, int id ) : IDockWindow
window IWin32Window The form window that is to be docked.
title string The window title.
alignment DockWindowAlignment Window alignment, or floating.
id int An identifier for this docked window. /// The ID must be greater than zero.
리턴 IDockWindow

FindColumn() 공개 메소드

Gets the position that corresponds to a line and column.
public FindColumn ( int line, int column ) : TextLocation
line int The one-based line number.
column int The one-based column number.
리턴 TextLocation

FocusEditor() 공개 메소드

Sets the focus to the current editor window.
public FocusEditor ( ) : void
리턴 void

GetActiveFileIndex() 공개 메소드

Gets the current document index in the specified view.
public GetActiveFileIndex ( EditorView view ) : int
view EditorView The view in which the active file index will be retrieved.
리턴 int

GetDockWindow() 공개 메소드

Gets the dock window object for the specified ID.
public GetDockWindow ( int id ) : IDockWindow
id int The ID number for the dock window object.
리턴 IDockWindow

GetFileNames() 공개 메소드

Gets a list of open file names in the specified view.
To get a list of all open file names in both views, you can use the 'FileNames' property.
public GetFileNames ( EditorView view ) : IEnumerable
view EditorView The editor view to retrieve the list of open file names.
리턴 IEnumerable

GetLanguageName() 공개 메소드

Gets the name of a language, given the ID.
public GetLanguageName ( int langId ) : string
langId int The language ID.
리턴 string

GetLineEndPos() 공개 메소드

Gets the ending position of the specified line, before any line-end characters.
public GetLineEndPos ( int line ) : TextLocation
line int The one-based line number.
리턴 TextLocation

GetLineLength() 공개 메소드

Gets the length of the specified line (excluding line-end characters).
public GetLineLength ( int line ) : int
line int The one-based line number.
리턴 int

GetLineStartPos() 공개 메소드

Gets the starting position of the specified line.
public GetLineStartPos ( int line ) : TextLocation
line int The one-based line number.
리턴 TextLocation

GetLineText() 공개 메소드

Gets the text for the specified line.
public GetLineText ( int line ) : string
line int The one-based line number.
리턴 string

GetLineText() 공개 메소드

Gets the text for the specified line, optionally including line-end characters.
public GetLineText ( int line, bool includeLineEndChars ) : string
line int The one-based line number.
includeLineEndChars bool If true, the returned string will contain the line-end characters.
리턴 string

GetText() 공개 메소드

Gets the text for the specified range.
public GetText ( TextLocation start, TextLocation end ) : string
start TextLocation The starting position.
end TextLocation The ending position (exclusive).
리턴 string

GetText() 공개 메소드

Gets the text for the specified range.
public GetText ( TextLocation start, int numChars ) : string
start TextLocation The starting position.
numChars int The number of characters to retrieve.
리턴 string

GetWordEndPos() 공개 메소드

Gets the position at the end of the current word.
public GetWordEndPos ( TextLocation pos, bool onlyWordChars ) : TextLocation
pos TextLocation The starting position.
onlyWordChars bool If true, only word characters will be jumped. /// If false, all characters will be jumped.
리턴 TextLocation

GetWordStartPos() 공개 메소드

Gets the position at the start of the current word.
public GetWordStartPos ( TextLocation pos, bool onlyWordChars ) : TextLocation
pos TextLocation The starting position.
onlyWordChars bool If true, only word characters will be jumped. /// If false, all characters will be jumped.
리턴 TextLocation

GoTo() 공개 메소드

Goes to the specified position and ensures it is visible.
public GoTo ( TextLocation pos ) : void
pos TextLocation The position to go to.
리턴 void

GoToLine() 공개 메소드

Goes to the specified line and ensures it is visible.
public GoToLine ( int line ) : void
line int The line to go to.
리턴 void

Insert() 공개 메소드

Inserts text over the current selection. The caret is placed after the inserted text and scrolled into view.
public Insert ( string text ) : void
text string The text to be inserted.
리턴 void

LaunchFindInFiles() 공개 메소드

Launches the 'Find in Files' dialog.
public LaunchFindInFiles ( string dir, string filters ) : void
dir string The directory to be searched.
filters string The file filters to be searched.
리턴 void

MenuCommand() 공개 메소드

Triggers a menu item command.
public MenuCommand ( MenuCommand command ) : void
command MenuCommand The ID of the command to be triggered.
리턴 void

MenuCommand() 공개 메소드

Triggers a menu item command.
public MenuCommand ( int commandId ) : void
commandId int The ID of the command to be triggered.
리턴 void

MoveCaretInsideView() 공개 메소드

If the caret is outside the current view, it is moved to the nearest visible line. Any selection is lost.
public MoveCaretInsideView ( ) : void
리턴 void

MoveSelectedLinesDown() 공개 메소드

Moves the selected lines down one line, shifting the line below the selection.
public MoveSelectedLinesDown ( ) : void
리턴 void

MoveSelectedLinesUp() 공개 메소드

Moves the selected lines up one line, shifting the line above the selection.
public MoveSelectedLinesUp ( ) : void
리턴 void

OnLoad() 보호된 메소드

Called after the object has been created and initialized, but before the Notepad++ Ready notification.
protected OnLoad ( ) : void
리턴 void

OpenFile() 공개 메소드

Opens a new file. If the file is already open, it will be made active.
public OpenFile ( string fileName ) : bool
fileName string The pathname of the file to be opened.
리턴 bool

Paste() 공개 메소드

Pastes the clipboard text over the selection.
public Paste ( ) : void
리턴 void

PointToPos() 공개 메소드

Finds the position closest to a point on the screen.
public PointToPos ( Point pt ) : TextLocation
pt Point The client coordinates of the point to test.
리턴 TextLocation

PointToPosClose() 공개 메소드

Finds the position closest to a point on the screen.
public PointToPosClose ( Point pt, TextLocation &location ) : bool
pt Point The client coordinates of the point to test.
location TextLocation An out parameter to receive the found location.
리턴 bool

PosToPoint() 공개 메소드

Returns the x and y display location of the position.
public PosToPoint ( TextLocation pos ) : Point
pos TextLocation The position to find.
리턴 Point

RefreshCustomLexers() 공개 메소드

Refreshes the word-styles and folding on documents that use a custom lexer provided via NppSharp.
This function is useful if your lexers providing highlighting that can change, and need to be refreshed at certain events.
public RefreshCustomLexers ( ) : void
리턴 void

ReloadFile() 공개 메소드

Reloads the current file.
public ReloadFile ( bool withAlert ) : void
withAlert bool If true, Notepad++ will show an alert box to confirm.
리턴 void

ReloadFile() 공개 메소드

Reloads a file given the file name. If the file is not already open, then this has no effect.
public ReloadFile ( string fileName, bool withAlert ) : void
fileName string The pathname of the file to be reloaded.
withAlert bool If true, Notepad++ will show an alert box to confirm.
리턴 void

SaveAllFiles() 공개 메소드

Saves all open documents.
public SaveAllFiles ( ) : bool
리턴 bool

SaveFile() 공개 메소드

Saves the current document.
public SaveFile ( ) : bool
리턴 bool

SaveFileAs() 공개 메소드

Saves the current document to another file name.
public SaveFileAs ( string fileName ) : bool
fileName string The pathname of the file to be written.
리턴 bool

SaveFileCopyAs() 공개 메소드

Saves a copy of the current document to another file name.
public SaveFileCopyAs ( string fileName ) : bool
fileName string The pathname of the file to be written.
리턴 bool

SelectAll() 공개 메소드

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

SetActiveFileIndex() 공개 메소드

Switches to the file in the specified view.
public SetActiveFileIndex ( EditorView view, int index ) : void
view EditorView The view in which the file is to be switched.
index int Zero-based index of the view to switch to.
리턴 void

SetEmptySelection() 공개 메소드

Removes the selection and sets the caret at pos. (The caret is not scrolled into view)
public SetEmptySelection ( TextLocation pos ) : void
pos TextLocation The new start/end position for the selection.
리턴 void

SetSelection() 공개 메소드

Sets the selection range. (The caret is scrolled into view)
public SetSelection ( TextLocation anchorPos, TextLocation currentPos ) : void
anchorPos TextLocation The selection anchor position.
currentPos TextLocation The selection current position.
리턴 void

ShowAutoCompletion() 공개 메소드

Shows the AutoCompletion list.
public ShowAutoCompletion ( int lengthEntered, IEnumerable list ) : void
lengthEntered int The number of characters already entered by the user.
list IEnumerable The list of words.
리턴 void

ShowAutoCompletion() 공개 메소드

Shows the AutoCompletion list.
public ShowAutoCompletion ( int lengthEntered, IEnumerable list, bool ignoreCase ) : void
lengthEntered int The number of characters already entered by the user.
list IEnumerable The list of words.
ignoreCase bool Ignore case?
리턴 void

ShowError() 공개 메소드

Displays an error message caused by an exception.
public ShowError ( Exception ex ) : void
ex System.Exception The exception that caused the error.
리턴 void

ShowError() 공개 메소드

Displays an error message caused by an exception, with additional text.
public ShowError ( Exception ex, string message ) : void
ex System.Exception The exception that caused the error (will be displayed in details tab).
message string Additional text to be displayed in message tab.
리턴 void

ShowError() 공개 메소드

Displays an error message.
public ShowError ( string message ) : void
message string The message to be displayed.
리턴 void

SwitchToFile() 공개 메소드

Switches to a file given the file name.
public SwitchToFile ( string fileName ) : bool
fileName string The pathname of the file to be brought current.
리턴 bool