Class CsType
Data model that represents the definition of a type.
Inherited Members
Namespace: CodeFactory.DotNet.CSharp
Assembly: CodeFactory.DotNet.dll
Syntax
public abstract class CsType : CsModel, ICsType, ICsModel, ICsGeneric, IDotNetType, IDotNetModel, IModelStatus, IDotNetGeneric
Constructors
| Improve this Doc View SourceCsType(bool, bool, bool, SourceCodeType, bool, bool, IReadOnlyList<CsGenericParameter>, IReadOnlyList<CsType>, string, string, bool, string, bool, bool, bool, bool, bool, bool, IReadOnlyList<int>, bool, bool, bool, bool, IReadOnlyList<CsTupleTypeParameter>, CsKnownLanguageType, string, ModelStore<ICsModel>, IReadOnlyList<ModelLoadException>)
Constructor for the CsType
Declaration
protected CsType(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCodeType language, bool isGeneric, bool hasStrongTypesInGenerics, IReadOnlyList<CsGenericParameter> genericParameters, IReadOnlyList<CsType> genericTypes, string name, string ns, bool isWellKnownType, string valueTypeDefaultValue, bool isValueType, bool supportsDisposable, bool isInterface, bool isStructure, bool isClass, bool isArray, IReadOnlyList<int> arrayDimensions, bool isGenericPlaceHolder, bool isEnum, bool isDelegate, bool isTuple, IReadOnlyList<CsTupleTypeParameter> tupleTypes, CsKnownLanguageType wellKnownType, 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. |
bool | isGeneric | Flag that determines if the type is generic. |
bool | hasStrongTypesInGenerics | Flag that determines if the generics are strong types or placeholders. |
IReadOnlyList<CsGenericParameter> | genericParameters | Generic parameters assigned to the type. |
IReadOnlyList<CsType> | genericTypes | The type definitions for the generic implementation. |
string | name | The name of the type. |
string | ns | The namespace the type belongs to. |
bool | isWellKnownType | Is the type one of the well known types for the language. |
string | valueTypeDefaultValue | The default value if the type is a value type. |
bool | isValueType | Flag that determines if it is a value type. |
bool | supportsDisposable | Flag that determines if the type implements IDisposable interface. |
bool | isInterface | Flag that determines if the type is an interface definition. |
bool | isStructure | Flag that determines if the type is a structure definition. |
bool | isClass | Flag that determines if the type is a class definition. |
bool | isArray | Flag that determines if the type is also an array. |
IReadOnlyList<int> | arrayDimensions | The dimensions assigned to the array. |
bool | isGenericPlaceHolder | Flag that determines if the type is a generic place holder definition. |
bool | isEnum | Flag that determines if the type is an enumeration. |
bool | isDelegate | Flag that determines if the type is a delegate definition. |
bool | isTuple | Flag that determines if the type is a tuple. |
IReadOnlyList<CsTupleTypeParameter> | tupleTypes | The type information for each part of the tuple. |
CsKnownLanguageType | wellKnownType | The well known type from the language if it is well known. |
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. |
Properties
| Improve this Doc View SourceArrayDimensions
Gets a list of the dimensions that are assigned to the array. This will contain more then one value if the array is a jagged array. This will be empty if the type is not an array.
Declaration
public IReadOnlyList<int> ArrayDimensions { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<int> |
GenericParameters
List of the generic parameters assigned.
Declaration
public IReadOnlyList<CsGenericParameter> GenericParameters { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<CsGenericParameter> |
GenericTypes
List of the strong types that are implemented for each generic parameter. This will be an empty List when there is no generic types implemented.
Declaration
public IReadOnlyList<CsType> GenericTypes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<CsType> |
HasStrongTypesInGenerics
Flag that determines if the generics implementation has strong types passed in to the generics implementation.
Declaration
public bool HasStrongTypesInGenerics { get; }
Property Value
Type | Description |
---|---|
bool |
IsArray
Flag that determines if the type is an array of the target type.
Declaration
public bool IsArray { get; }
Property Value
Type | Description |
---|---|
bool |
IsClass
Flag that determines if the type is a class.
Declaration
public bool IsClass { get; }
Property Value
Type | Description |
---|---|
bool |
IsDelegate
Flag that determines if the type is a delegate.
Declaration
public bool IsDelegate { get; }
Property Value
Type | Description |
---|---|
bool |
IsEnum
Flag that determines if the type is a enumeration.
Declaration
public bool IsEnum { get; }
Property Value
Type | Description |
---|---|
bool |
IsGeneric
Flag the determines if this item supports generics
Declaration
public bool IsGeneric { get; }
Property Value
Type | Description |
---|---|
bool |
IsGenericPlaceHolder
Flag that determines if the type is a generic place holder definition.
Declaration
public bool IsGenericPlaceHolder { get; }
Property Value
Type | Description |
---|---|
bool |
IsInterface
Flag that determines if the type is an interface.
Declaration
public bool IsInterface { get; }
Property Value
Type | Description |
---|---|
bool |
IsStructure
Flag that determines if the type is a structure.
Declaration
public bool IsStructure { get; }
Property Value
Type | Description |
---|---|
bool |
IsTuple
Flag that determine if the type is a Tuple
Declaration
public bool IsTuple { get; }
Property Value
Type | Description |
---|---|
bool |
IsValueType
Flag that determines if the type is a value type.
Declaration
public bool IsValueType { get; }
Property Value
Type | Description |
---|---|
bool |
IsWellKnownType
Flag that determines if the type is one of the well know data types of the language.
Declaration
public bool IsWellKnownType { get; }
Property Value
Type | Description |
---|---|
bool |
Name
The name of the type.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
Namespace
The namespace the type belongs to.
Declaration
public string Namespace { get; }
Property Value
Type | Description |
---|---|
string |
SupportsDisposable
Flag that determines if the type supports the interface IDisposable.
Declaration
public bool SupportsDisposable { get; }
Property Value
Type | Description |
---|---|
bool |
TupleTypes
List of the types that are implemented in the Tuple. This will an empty list if the type is not a tuple.
Declaration
public IReadOnlyList<CsTupleTypeParameter> TupleTypes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<CsTupleTypeParameter> |
ValueTypeDefaultValue
The default value for well known value data types. This will be null if the value is not a well known value type.
Declaration
public string ValueTypeDefaultValue { get; }
Property Value
Type | Description |
---|---|
string |
WellKnownType
Enumeration of the target well known type this type represents.
Declaration
public CsKnownLanguageType WellKnownType { get; }
Property Value
Type | Description |
---|---|
CsKnownLanguageType |
Methods
| Improve this Doc View SourceGetClassModel()
Loads the full ICsClass model from the type definition.
Declaration
public CsClass GetClassModel()
Returns
Type | Description |
---|---|
CsClass | Return the fully loaded model or an empty model if the type is not a class. |
GetClassModelData()
Loads the full ICsClass model from the type definition.
Declaration
protected abstract CsClass GetClassModelData()
Returns
Type | Description |
---|---|
CsClass | Return the fully loaded model or an empty model if the type is not a class. |
GetDelegateModel()
Loads the full ICsDelegate model from the type definition.
Declaration
public CsDelegate GetDelegateModel()
Returns
Type | Description |
---|---|
CsDelegate | Return the fully loaded model or an empty model if the type is not a delegate. |
GetDelegateModelData()
Loads the full ICsDelegate model from the type definition.
Declaration
protected abstract CsDelegate GetDelegateModelData()
Returns
Type | Description |
---|---|
CsDelegate | Return the fully loaded model or an empty model if the type is not a delegate. |
GetEnumModel()
Loads the full ICsEnum model from the type definition.
Declaration
public CsEnum GetEnumModel()
Returns
Type | Description |
---|---|
CsEnum | Return the fully loaded model or an empty model if the type is not an enumeration. |
GetEnumModelData()
Logic to load the full model data for an enumeration.
Declaration
protected abstract CsEnum GetEnumModelData()
Returns
Type | Description |
---|---|
CsEnum | Return the fully loaded model or an empty model if the type is not an enumeration. |
GetInterfaceModel()
Loads the full CsInterface model from the type definition.
Declaration
public CsInterface GetInterfaceModel()
Returns
Type | Description |
---|---|
CsInterface | Return the fully loaded model or an empty model if the type is not an interface. |
GetInterfaceModelData()
Loads the full ICsInterface model from the type definition.
Declaration
protected abstract CsInterface GetInterfaceModelData()
Returns
Type | Description |
---|---|
CsInterface | Return the fully loaded model or an empty model if the type is not an interface. |
GetStructureModel()
Loads the full ICsStructure model from the type definition.
Declaration
public CsStructure GetStructureModel()
Returns
Type | Description |
---|---|
CsStructure | Return the fully loaded model or an empty model if the type is not a structure. |
GetStructureModelData()
Loads the full ICsStructure model from the type definition.
Declaration
protected abstract CsStructure GetStructureModelData()
Returns
Type | Description |
---|---|
CsStructure | Return the fully loaded model or an empty model if the type is not a structure. |
Explicit Interface Implementations
| Improve this Doc View SourceIDotNetGeneric.GenericParameters
List of the generic parameters assigned.
Declaration
IReadOnlyList<IDotNetGenericParameter> IDotNetGeneric.GenericParameters { get; }
Returns
Type | Description |
---|---|
IReadOnlyList<IDotNetGenericParameter> |
IDotNetGeneric.GenericTypes
Enumeration of the strong types that are implemented for each generic parameter. This will be an empty list when there is no generic types implemented.
Declaration
IReadOnlyList<IDotNetType> IDotNetGeneric.GenericTypes { get; }
Returns
Type | Description |
---|---|
IReadOnlyList<IDotNetType> |
IDotNetType.GetClassModel()
Loads the full IDotNetClass model from the type definition.
Declaration
IDotNetClass IDotNetType.GetClassModel()
Returns
Type | Description |
---|---|
IDotNetClass | Return the fully loaded model or an empty model if the type is not a class. |
IDotNetType.GetDelegateModel()
Loads the full IDotNetDelegate model from the type definition.
Declaration
IDotNetDelegate IDotNetType.GetDelegateModel()
Returns
Type | Description |
---|---|
IDotNetDelegate | Return the fully loaded model or an empty model if the type is not a delegate. |
IDotNetType.GetEnumModel()
Loads the full IDotNetEnum model from the type definition.
Declaration
IDotNetEnum IDotNetType.GetEnumModel()
Returns
Type | Description |
---|---|
IDotNetEnum | Return the fully loaded model or an empty model if the type is not an enumeration. |
IDotNetType.GetInterfaceModel()
Loads the full IDotNetInterface model from the type definition.
Declaration
IDotNetInterface IDotNetType.GetInterfaceModel()
Returns
Type | Description |
---|---|
IDotNetInterface | Return the fully loaded model or an empty model if the type is not an interface. |
IDotNetType.GetStructureModel()
Loads the full IDotNetStructure model from the type definition.
Declaration
IDotNetStructure IDotNetType.GetStructureModel()
Returns
Type | Description |
---|---|
IDotNetStructure | Return the fully loaded model or an empty model if the type is not a structure. |
IDotNetType.TupleTypes
List of the types that are implemented in the Tuple. This will an empty list if the type is not a tuple.
Declaration
IReadOnlyList<IDotNetTupleTypeParameter> IDotNetType.TupleTypes { get; }
Returns
Type | Description |
---|---|
IReadOnlyList<IDotNetTupleTypeParameter> |
IDotNetType.WellKnownType
Enumeration of the target well known type this type represents.
Declaration
WellKnownLanguageType IDotNetType.WellKnownType { get; }
Returns
Type | Description |
---|---|
WellKnownLanguageType |