Class CsGenericParameter
Data model that represents the a generic parameter definition.
Inherited Members
Namespace: CodeFactory.DotNet.CSharp
Assembly: CodeFactory.DotNet.dll
Syntax
public abstract class CsGenericParameter : CsModel, ICsGenericParameter, ICsModel, IDotNetGenericParameter, IDotNetModel, IModelStatus
Constructors
| Improve this Doc View SourceCsGenericParameter(bool, bool, bool, SourceCodeType, CsModelType, bool, bool, bool, bool, bool, IReadOnlyList<CsType>, CsType, string, ModelStore<ICsModel>, IReadOnlyList<ModelLoadException>)
Constructor for the CsGenericParameter
Declaration
protected CsGenericParameter(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCodeType language, CsModelType modelType, bool hasOutKeyword, bool hasNewConstraint, bool hasClassConstraint, bool hasStructConstraint, bool hasConstraintTypes, IReadOnlyList<CsType> constrainingTypes, CsType type, 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. |
bool | hasOutKeyword | Flag that determines if parameter has out keyword assigned. |
bool | hasNewConstraint | Flag that determines if generic parameter supports new keyword. |
bool | hasClassConstraint | flag that determines if the generic parameter has a constraint requirement to classes. |
bool | hasStructConstraint | Flag that determines if the generic parameter has a constraint requirement to structures. |
bool | hasConstraintTypes | Flag that determines if the generic parameter has additional type constraints. |
IReadOnlyList<CsType> | constrainingTypes | List of of additional constraints the generic parameter supports. |
CsType | type | The type definition for the generic type |
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 SourceConstrainingTypes
The constraining types the generic parameter must ad hear to. If there are no constraining types an empty list will be returned.
Declaration
public IReadOnlyList<CsType> ConstrainingTypes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<CsType> |
HasClassConstraint
Flag that determines if the generic parameter has a constraint that it must implement from a class.
Declaration
public bool HasClassConstraint { get; }
Property Value
Type | Description |
---|---|
bool |
HasConstraintTypes
Flag that determines if the generic parameter has constraining types the parameter must ad hear to.
Declaration
public bool HasConstraintTypes { get; }
Property Value
Type | Description |
---|---|
bool |
HasNewConstraint
Flag that determines if the generic parameter has a constraint that is must support construction of a new type.
Declaration
public bool HasNewConstraint { get; }
Property Value
Type | Description |
---|---|
bool |
HasOutKeyword
Flag that determines if the generic parameter uses the out keyword.
Declaration
public bool HasOutKeyword { get; }
Property Value
Type | Description |
---|---|
bool |
HasStructConstraint
Flag that determines if the generic parameter has a constraint that is must implement from a structure.
Declaration
public bool HasStructConstraint { get; }
Property Value
Type | Description |
---|---|
bool |
Type
The type definition of the generic parameter.
Declaration
public CsType Type { get; }
Property Value
Type | Description |
---|---|
CsType |
Explicit Interface Implementations
| Improve this Doc View SourceIDotNetGenericParameter.ConstrainingTypes
The constraining types the generic parameter must ad hear to. If there are no constraining types an empty list will be returned.
Declaration
IReadOnlyList<IDotNetType> IDotNetGenericParameter.ConstrainingTypes { get; }
Returns
Type | Description |
---|---|
IReadOnlyList<IDotNetType> |
IDotNetGenericParameter.Type
The type definition of the generic parameter.
Declaration
IDotNetType IDotNetGenericParameter.Type { get; }
Returns
Type | Description |
---|---|
IDotNetType |