Struct TextIndentHelper
A helper object for making text indentation management easier, particularly when working with code generation
Namespace: Atlas
Assembly: Atlas.Editor.dll
Syntax
public struct TextIndentHelper
Constructors
| Improve this Doc View SourceTextIndentHelper(Char, Int32)
Constructor
Declaration
public TextIndentHelper(char indentCharacter = ' ', int charactersPerIndent = 4)
Parameters
Type | Name | Description |
---|---|---|
System.Char | indentCharacter | The character to use as indentation, with a space as default |
System.Int32 | charactersPerIndent | Number of characters to use per indentation |
Fields
| Improve this Doc View SourceStandardSpacesHelper
Default helper for providing 4 spaces per indentation
Declaration
public static readonly TextIndentHelper StandardSpacesHelper
Field Value
Type | Description |
---|---|
TextIndentHelper |
StandardTabHelper
Default helper for providing 1 tab per indentation
Declaration
public static readonly TextIndentHelper StandardTabHelper
Field Value
Type | Description |
---|---|
TextIndentHelper |
Properties
| Improve this Doc View SourceCharactersPerIndent
Number of characters to use per indentation
Declaration
public int CharactersPerIndent { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Indent
A string representing the current indentation level. This will initially be an empty string.
Declaration
public string Indent { get; }
Property Value
Type | Description |
---|---|
System.String |
IndentLevel
The current level/number of indentations
Declaration
public int IndentLevel { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceApplyIndent(String)
Helper method for applying the current indentation to the given string.
This is equivalent to prepending Indent to the front of text
Declaration
public string ApplyIndent(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The string to apply indentation to |
Returns
Type | Description |
---|---|
System.String | The indented string |