CodeFactory Platform CodeFactory Platform
CodeFactory Platform CodeFactory Platform
CodeFactory

Search Results for

    Class CsModel

    Base class that all C# compiler based data models derive from.

    Inheritance
    object
    CsModel
    CsAttribute
    CsAttributeParameter
    CsAttributeParameterValue
    CsContainer
    CsDelegate
    CsEnum
    CsEnumValue
    CsGenericParameter
    CsMember
    CsNamespace
    CsParameter
    CsParameterDefaultValue
    CsSource
    CsTupleTypeParameter
    CsType
    CsUsingStatement
    Implements
    ICsModel
    IDotNetModel
    IModelStatus
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: CodeFactory.DotNet.CSharp
    Assembly: CodeFactory.DotNet.dll
    Syntax
    public abstract class CsModel : ICsModel, IDotNetModel, IModelStatus

    Constructors

    | Improve this Doc View Source

    CsModel(bool, bool, bool, SourceCodeType, CsModelType, string, ModelStore<ICsModel>, IReadOnlyList<ModelLoadException>)

    Constructor for the CsModel

    Declaration
    protected CsModel(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCodeType language, CsModelType modelType, string sourceDocument = null, ModelStore<ICsModel> modelStore = null, IReadOnlyList<ModelLoadException> modelErrors = null)
    Parameters
    Type Name Description
    bool isLoaded

    Flag that determines if the model was loaded.

    bool hasErrors

    Flag that determine if errors were found creating the model.

    bool loadedFromSource

    Flag that determines if the model was loaded from source code or from an existing library.

    SourceCodeType language

    The target language the model was generated from.

    CsModelType modelType

    The type of code model created.

    string sourceDocument

    The source document that was used to build this model. This is optional parameter and can be null.

    ModelStore<ICsModel> modelStore

    Optional the lookup storage for models created during the compile or lookup of the model.

    IReadOnlyList<ModelLoadException> modelErrors

    Optional the error that occurred while creating the model.

    Fields

    | Improve this Doc View Source

    LocalModelErrors

    Model field that stores the models load exceptions.

    Declaration
    protected readonly IReadOnlyList<ModelLoadException> LocalModelErrors
    Field Value
    Type Description
    IReadOnlyList<ModelLoadException>
    | Improve this Doc View Source

    ModelStore

    Model field used to lookup models that were created during the compile or reference lookup using the C# compiler.

    Declaration
    protected readonly ModelStore<ICsModel> ModelStore
    Field Value
    Type Description
    ModelStore<ICsModel>

    Properties

    | Improve this Doc View Source

    HasErrors

    Flag that determines if this model or one of the children of this model has an error.

    Declaration
    public bool HasErrors { get; }
    Property Value
    Type Description
    bool
    | Improve this Doc View Source

    IsLoaded

    Flag that determines if this model was able to load.

    Declaration
    public bool IsLoaded { get; }
    Property Value
    Type Description
    bool
    | Improve this Doc View Source

    Language

    The target language this model was loaded from.

    Declaration
    public SourceCodeType Language { get; }
    Property Value
    Type Description
    SourceCodeType
    | Improve this Doc View Source

    LoadedFromSource

    Flag that determines if this model was loaded from source code or was loaded through reflects or symbol libraries.

    Declaration
    public bool LoadedFromSource { get; }
    Property Value
    Type Description
    bool
    | Improve this Doc View Source

    ModelType

    The type of c# model that is implemented.

    Declaration
    public CsModelType ModelType { get; }
    Property Value
    Type Description
    CsModelType
    | Improve this Doc View Source

    SourceDocument

    The fully qualified path to the document that was used to load the model from source. This will be populated if the model was loaded from source.

    Declaration
    public string SourceDocument { get; }
    Property Value
    Type Description
    string

    Methods

    | Improve this Doc View Source

    GetErrors()

    Gets the ModelLoadException from the current model and all child models of this model.

    Declaration
    public abstract IReadOnlyList<ModelLoadException> GetErrors()
    Returns
    Type Description
    IReadOnlyList<ModelLoadException>

    Returns a IReadOnlyList<T> of the ModelLoadException exceptions or an empty list if no exceptions exist.

    | Improve this Doc View Source

    GetModel(string)

    Declaration
    public CsModel GetModel(string lookupPath)
    Parameters
    Type Name Description
    string lookupPath
    Returns
    Type Description
    CsModel
    | Improve this Doc View Source

    GetModel<T>(string)

    Declaration
    public T GetModel<T>(string lookupPath) where T : class, ICsModel
    Parameters
    Type Name Description
    string lookupPath
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    LookupModel(string)

    Helper method that looks up a code factory model from the model store.

    Declaration
    [Obsolete("LookupModel is obsolete and will be removed in later versions of the framework. Use GetModel or GetModel<T>", false)]
    protected CsModel LookupModel(string path)
    Parameters
    Type Name Description
    string path

    The fully qualified path of the model to be loaded from the model store.

    Returns
    Type Description
    CsModel

    The loaded model or null if the model could not be loaded, or found.

    Explicit Interface Implementations

    | Improve this Doc View Source

    IDotNetModel.ModelType

    The type of dot net model that was loaded.

    Declaration
    DotNetModelType IDotNetModel.ModelType { get; }
    Returns
    Type Description
    DotNetModelType

    Implements

    ICsModel
    IDotNetModel
    IModelStatus

    Extension Methods

    CSharpModelExtensions.ToModel<T>(CsModel)
    © CodeFactory, LLC. All rights reserved.