C# Класс Emmet.Snippets.CodeSnippet

Represents a region of source code in the editor that has some tab stops in it.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BeginEditSnippet ( ) : void

Moves caret to the first tab stop in the active snippet.

CreateSnippetInView ( ViewContext view, Span tabStops, int tabStopGroups ) : CodeSnippet

Creates code snippet in the specified view.

EndEditSnippet ( ) : void

Detaches this object from the target view.

GetTabStopsPositions ( ) : Span[]

Gets this snippet tab stops positions in the active text snapshot.

TryMoveToNextTabStop ( bool reverse = false ) : bool

Tries to move caret to next tab stop. Returns true if succeeded; false otherwise. False indicates that caret is not inside any of the available tab stops which indicates that tab stops tracking should be finished and this snippet should be detached from the view.

Приватные методы

Метод Описание
CodeSnippet ( ) : Microsoft.VisualStudio.Text

Initializes a new instance of the CodeSnippet class. Constructor that prevents a default instance of this class from being created.

ConvertToTrackingSpans ( ViewContext view, Span spans ) : ITrackingSpan[]
GetLastTabStopInGroup ( int index ) : int
MoveToSpan ( ITrackingSpan span ) : void
MoveToSpan ( SnapshotSpan target ) : void

Описание методов

BeginEditSnippet() публичный Метод

Moves caret to the first tab stop in the active snippet.
public BeginEditSnippet ( ) : void
Результат void

CreateSnippetInView() публичный статический Метод

Creates code snippet in the specified view.
public static CreateSnippetInView ( ViewContext view, Span tabStops, int tabStopGroups ) : CodeSnippet
view ViewContext Editor view that contains snippet.
tabStops Span Tab stops collection.
tabStopGroups int Groups the tab stop belongs to.
Результат CodeSnippet

EndEditSnippet() публичный Метод

Detaches this object from the target view.
public EndEditSnippet ( ) : void
Результат void

GetTabStopsPositions() публичный Метод

Gets this snippet tab stops positions in the active text snapshot.
public GetTabStopsPositions ( ) : Span[]
Результат Span[]

TryMoveToNextTabStop() публичный Метод

Tries to move caret to next tab stop. Returns true if succeeded; false otherwise. False indicates that caret is not inside any of the available tab stops which indicates that tab stops tracking should be finished and this snippet should be detached from the view.
public TryMoveToNextTabStop ( bool reverse = false ) : bool
reverse bool Indicates whether move should be made in reverse direction.
Результат bool