Search Results for

    Show / Hide Table of Contents

    Class ClassFileWriter

    A simple file responsible for creating a file with the usings, namespaces and body code.

    The file is laid out as so:

    • Usings: List of all using statements added by AddUsing(String).
    • Namespaces: List of all namespaces added using BeginNamespace(String).
    • Body: List of all body code statements added using AddBody(String).
    • Namespaces: List of all namespaces closings added using EndNamespace()
    Inheritance
    System.Object
    ClassFileWriter
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.API.Descriptors.Writers
    Assembly: API.dll
    Syntax
    public class ClassFileWriter

    Methods

    AddBody(String)

    An actual code block for the file to add

    Declaration
    public void AddBody(string body)
    Parameters
    Type Name Description
    System.String body

    The code to add to the file

    AddIfMissingUsing(String)

    Adds the specified using statement to the list if it currently does not exist

    Declaration
    public void AddIfMissingUsing(string usingStatement)
    Parameters
    Type Name Description
    System.String usingStatement

    AddUsing(String)

    Adds the specified using statement to the list.

    Declaration
    public void AddUsing(string usings)
    Parameters
    Type Name Description
    System.String usings

    The using statement to add. This does not need the [using] part of the string, the writer adds that for each using statement as needed

    BeginNamespace(String)

    Adds the beginning of a namespace. This should be closed using a corrosponding EndNamespace() call after adding the appropriate body statements

    Declaration
    public void BeginNamespace(string nameSpace)
    Parameters
    Type Name Description
    System.String nameSpace

    The namespace to add body code into. This does not need the [namespace] part of the string, the writer adds that for each namespace statement as needed

    EndNamespace()

    Closes a namespace. This should corrospond to a namespace added using BeginNamespace(String)

    Declaration
    public void EndNamespace()

    RemoveUsing(String)

    Removes the specified using statement from the fil

    Declaration
    public void RemoveUsing(string usings)
    Parameters
    Type Name Description
    System.String usings

    The using statement to remove. This does not need the [using] part of the string, the writer adds that for each using statement as needed

    WriteFile()

    Creates the entire file by putting the usings, namespaces and body code together as appropriate

    Declaration
    public string WriteFile()
    Returns
    Type Description
    System.String

    The entire file by putting the usings, namespaces and body code together as appropriate

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToCSVFormatString(Object, Type)
    SQLExtensions.ToSQLValue(Object, Boolean)
    ClassFileWriterExtensions.AddStandardUsings(ClassFileWriter)
    In This Article
    Back to top © LemonTree Software Ltd. All rights reserved.