C# Class Emmet.EmmetEditor

Implements editor interface required by the Emmet engine based on the Visual Studio editor.
Inheritance: IEmmetEditor
显示文件 Open project: sergey-rybalkin/emmet.net Class Usage Examples

Public Methods

Method Description
CreateSelection ( int start, int end ) : void

Selects the specified text range.

EmmetEditor ( IWpfTextView wpfView, IVsTextView textView ) : System.Windows.Forms

Initializes a new instance of the EmmetEditor class.

FormatRegion ( int startPosition = -1, int endPosition ) : void

Formats the specified code region. If region position is negative then the whole document will be formatted.

GetCaretPosition ( ) : int

Gets caret position.

GetContent ( ) : string

Gets the content of the editor.

GetContentTypeInActiveBuffer ( ) : string

Gets content type of the text buffer that has the caret.

GetCurrentLine ( ) : string

Gets text on the current line.

GetCurrentLineRange ( ) : Range

Gets indexes of the first and last characters of the current line in the editor.

GetSelection ( ) : string

Gets currently selected text.

GetSelectionRange ( ) : Range

Gets current selection range or caret position if no selection exists.

Prompt ( ) : string

Displays dialog box that prompts user for input.

ReplaceContentRange ( string newContent, int startPosition = -1, int endPosition ) : void

Replaces the specified region in the document with the new content. If region start position is negative then the whole document will be replaced with the specified content.

SetCaretPosition ( int position ) : void

Sets the caret position.

TrackTabStops ( Range tabStops, int tabStopGroups ) : void

Starts tracking the specified regions as tab stops.

Method Details

CreateSelection() public method

Selects the specified text range.
public CreateSelection ( int start, int end ) : void
start int First character to select.
end int Last character to select.
return void

EmmetEditor() public method

Initializes a new instance of the EmmetEditor class.
public EmmetEditor ( IWpfTextView wpfView, IVsTextView textView ) : System.Windows.Forms
wpfView IWpfTextView The WPF interface for the editor.
textView IVsTextView The text view interface for the editor.
return System.Windows.Forms

FormatRegion() public method

Formats the specified code region. If region position is negative then the whole document will be formatted.
public FormatRegion ( int startPosition = -1, int endPosition ) : void
startPosition int The start position of the region to format.
endPosition int The end position of the region to format.
return void

GetCaretPosition() public method

Gets caret position.
public GetCaretPosition ( ) : int
return int

GetContent() public method

Gets the content of the editor.
public GetContent ( ) : string
return string

GetContentTypeInActiveBuffer() public method

Gets content type of the text buffer that has the caret.
public GetContentTypeInActiveBuffer ( ) : string
return string

GetCurrentLine() public method

Gets text on the current line.
public GetCurrentLine ( ) : string
return string

GetCurrentLineRange() public method

Gets indexes of the first and last characters of the current line in the editor.
public GetCurrentLineRange ( ) : Range
return Emmet.Engine.Range

GetSelection() public method

Gets currently selected text.
public GetSelection ( ) : string
return string

GetSelectionRange() public method

Gets current selection range or caret position if no selection exists.
public GetSelectionRange ( ) : Range
return Emmet.Engine.Range

Prompt() public method

Displays dialog box that prompts user for input.
public Prompt ( ) : string
return string

ReplaceContentRange() public method

Replaces the specified region in the document with the new content. If region start position is negative then the whole document will be replaced with the specified content.
public ReplaceContentRange ( string newContent, int startPosition = -1, int endPosition ) : void
newContent string New content to replace the specified range with.
startPosition int The start position of the range to replace.
endPosition int The end position of the range to replace.
return void

SetCaretPosition() public method

Sets the caret position.
public SetCaretPosition ( int position ) : void
position int New caret position.
return void

TrackTabStops() public method

Starts tracking the specified regions as tab stops.
public TrackTabStops ( Range tabStops, int tabStopGroups ) : void
tabStops Emmet.Engine.Range The tab stops array with start and end positions.
tabStopGroups int Tab stops groups indexes array.
return void