C# Class Microsoft.Languages.Core.Formatting.IndentBuilder

Afficher le fichier Open project: Microsoft/RTVS Class Usage Examples

Méthodes publiques

Méthode Description
CloseIndentLevel ( ) : void
GetIndentString ( int size ) : string
GetIndentString ( int size, IndentType indentType, int tabSize ) : string

Calculates indentation string given indent size in characters, type of indent (tabs or spaces) and size of the tab,

GetLineIndentSize ( TextBuilder tb, int position, int tabSize ) : int

Determines indentation based on the leading whitespace in the current line.

GetWhiteSpaceCharLength ( char character, int spacesSoFar, int tabSize ) : int

Returns a conversion of tabs or space to space count. You can't simply get the tab size from options, because spaces before tabs blend in with the tabs, while spaces after the tabs add up.

IndentBuilder ( IndentType indentType, int indentSize, int tabSize ) : System
IndentBuilder ( IndentType indentType, int indentSize, int tabSize, string baseIndent ) : System
NewIndentLevel ( ) : void
ResetBaseIndent ( string baseIndent ) : Microsoft.Languages.Core.Formatting.IndentState
RestoreIndentState ( Microsoft.Languages.Core.Formatting.IndentState indentState ) : void
SetIndentLevel ( int indentLevel ) : void
SetIndentLevelForSize ( int indentSize ) : void
TextIndentInSpaces ( string text, int tabSize ) : int

Given text string (typically content of a text buffer) calculates size of indentation (length of the leading whitespace in the line) in spaces.

TextLengthInSpaces ( string text, int tabSize ) : int

Calculates length of text in spaces, converting tabs to spaces using specified tab size.

Method Details

CloseIndentLevel() public méthode

public CloseIndentLevel ( ) : void
Résultat void

GetIndentString() public méthode

public GetIndentString ( int size ) : string
size int
Résultat string

GetIndentString() public static méthode

Calculates indentation string given indent size in characters, type of indent (tabs or spaces) and size of the tab,
public static GetIndentString ( int size, IndentType indentType, int tabSize ) : string
size int Desired indent size in characters
indentType IndentType Type of indent
tabSize int Tab size
Résultat string

GetLineIndentSize() public static méthode

Determines indentation based on the leading whitespace in the current line.
public static GetLineIndentSize ( TextBuilder tb, int position, int tabSize ) : int
tb TextBuilder
position int
tabSize int
Résultat int

GetWhiteSpaceCharLength() public static méthode

Returns a conversion of tabs or space to space count. You can't simply get the tab size from options, because spaces before tabs blend in with the tabs, while spaces after the tabs add up.
public static GetWhiteSpaceCharLength ( char character, int spacesSoFar, int tabSize ) : int
character char
spacesSoFar int
tabSize int
Résultat int

IndentBuilder() public méthode

public IndentBuilder ( IndentType indentType, int indentSize, int tabSize ) : System
indentType IndentType
indentSize int
tabSize int
Résultat System

IndentBuilder() public méthode

public IndentBuilder ( IndentType indentType, int indentSize, int tabSize, string baseIndent ) : System
indentType IndentType
indentSize int
tabSize int
baseIndent string
Résultat System

NewIndentLevel() public méthode

public NewIndentLevel ( ) : void
Résultat void

ResetBaseIndent() public méthode

public ResetBaseIndent ( string baseIndent ) : Microsoft.Languages.Core.Formatting.IndentState
baseIndent string
Résultat Microsoft.Languages.Core.Formatting.IndentState

RestoreIndentState() public méthode

public RestoreIndentState ( Microsoft.Languages.Core.Formatting.IndentState indentState ) : void
indentState Microsoft.Languages.Core.Formatting.IndentState
Résultat void

SetIndentLevel() public méthode

public SetIndentLevel ( int indentLevel ) : void
indentLevel int
Résultat void

SetIndentLevelForSize() public méthode

public SetIndentLevelForSize ( int indentSize ) : void
indentSize int
Résultat void

TextIndentInSpaces() public static méthode

Given text string (typically content of a text buffer) calculates size of indentation (length of the leading whitespace in the line) in spaces.
public static TextIndentInSpaces ( string text, int tabSize ) : int
text string
tabSize int
Résultat int

TextLengthInSpaces() public static méthode

Calculates length of text in spaces, converting tabs to spaces using specified tab size.
public static TextLengthInSpaces ( string text, int tabSize ) : int
text string
tabSize int
Résultat int