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
    object
    ClassFileWriter
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.API.Core.Writers
    Assembly: LemonEdge.API.dll
    Syntax
    public class ClassFileWriter

    Constructors

    ClassFileWriter()

    Declaration
    public ClassFileWriter()

    Methods

    AddBody(string)

    An actual code block for the file to add

    Declaration
    public void AddBody(string body)
    Parameters
    Type Name Description
    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
    string usingStatement

    AddUsing(string)

    Adds the specified using statement to the list.

    Declaration
    public void AddUsing(string usings)
    Parameters
    Type Name Description
    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
    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
    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
    string

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

    Extension Methods

    ClassFileWriterExtensions.AddStandardUsings(ClassFileWriter)
    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.