Search Results for

    Show / Hide Table of Contents

    Class TextGenerator

    A formatted text generator useful for creating text based files with some semblance of organization.

    Inheritance
    System.Object
    TextGenerator
    Namespace: GDX.Developer
    Syntax
    public class TextGenerator

    Constructors

    | Improve this Doc View Source

    TextGenerator(String, String, String)

    Create a new TextGenerator with the

    Declaration
    public TextGenerator(string indentContent = "\t", string indentOpen = null, string indentClose = null)
    Parameters
    Type Name Description
    System.String indentContent

    The characters used to indent the content when applicable. By default it will use a tab representation, however for code files you may want to use four spaces.

    System.String indentOpen
    System.String indentClose

    Methods

    | Improve this Doc View Source

    Append(String)

    Append content to the current line being operated on.

    Declaration
    public void Append(string content)
    Parameters
    Type Name Description
    System.String content

    The content to append to the current line.

    | Improve this Doc View Source

    AppendLine(String)

    Apply the appropriate amount of indentation to the current line, appending content afterwards and then advancing to the next line.

    Declaration
    public void AppendLine(string content = "")
    Parameters
    Type Name Description
    System.String content

    The content to append to the current line.

    | Improve this Doc View Source

    AppendLineRange(IEnumerable)

    Append an System.Collections.IEnumerable set of content as individual lines with proper indentation.

    Declaration
    public void AppendLineRange(IEnumerable content)
    Parameters
    Type Name Description
    System.Collections.IEnumerable content

    The content to be added.

    | Improve this Doc View Source

    ApplyIndent()

    Apply the current level of indent to the current line being operated on.

    Declaration
    public void ApplyIndent()
    | Improve this Doc View Source

    GetIndentLevel()

    Gets the current indent level of the TextGenerator.

    Declaration
    public int GetIndentLevel()
    Returns
    Type Description
    System.Int32

    The indent level.

    | Improve this Doc View Source

    NextLine()

    Move the builder to the start of the next line.

    Declaration
    public void NextLine()
    | Improve this Doc View Source

    PopIndent()

    Remove a level of indentation from the builder.

    Declaration
    public void PopIndent()
    | Improve this Doc View Source

    PushIndent(Boolean)

    Add a level of indentation to the builder.

    Declaration
    public void PushIndent(bool applyOpener = true)
    Parameters
    Type Name Description
    System.Boolean applyOpener

    Should the opener be applied?

    | Improve this Doc View Source

    ToString()

    Returns the built string content for the builder.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()
    Remarks

    Will automatically reduce the indentation level to 0.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Built on 2024-01-01 against 1f69a68.
    Generated by Dox+DocFX.