Class CsParameter
Data model that represents a parameter definition.
Implements
Inherited Members
Namespace: CodeFactory.DotNet.CSharp
Assembly: CodeFactory.DotNet.dll
Syntax
public abstract class CsParameter : CsModel, ICsParameter, ICsModel, ICsAttributes, IDotNetParameter, IDotNetModel, IModelStatus, IDotNetAttributes, ILookup, IParent, IParent
Constructors
| Improve this Doc View SourceCsParameter(bool, bool, bool, SourceCodeType, IReadOnlyList<CsAttribute>, string, string, bool, bool, bool, bool, bool, bool, string, CsType, CsParameterDefaultValue, string, ModelStore<ICsModel>, IReadOnlyList<ModelLoadException>)
Constructor for the CsParameter
Declaration
protected CsParameter(bool isLoaded, bool hasErrors, bool loadedFromSource, SourceCodeType language, IReadOnlyList<CsAttribute> attributes, string lookupPath, string name, bool isOut, bool isRef, bool isParams, bool isOptional, bool isGenericParameter, bool hasDefaultValue, string parentPath, CsType parameterType, CsParameterDefaultValue defaultValue, 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. |
IReadOnlyList<CsAttribute> | attributes | Attributes assigned to this model. |
string | lookupPath | The fully qualified path of the model that is stored in the model store. |
string | name | The name of the parameter. |
bool | isOut | Parameter is assigned the out keyword. |
bool | isRef | Parameter is assigned the ref keyword. |
bool | isParams | Parameter supports a parameter array. |
bool | isOptional | Parameter is optional. |
bool | isGenericParameter | Is a generic parameter. |
bool | hasDefaultValue | Parameter has an assigned default value. |
string | parentPath | The fully qualified path name for the parent model to this model. |
CsType | parameterType | The type that this parameter supports. |
CsParameterDefaultValue | defaultValue | The default value assigned to this parameter. |
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 SourceAttributes
The attributes assigned to this item. If the HasAttributes is false this will be an empty list.
Declaration
public IReadOnlyList<CsAttribute> Attributes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<CsAttribute> |
DefaultValue
The default value assigned to the parameter. This will be null if the HasDefaultValue property is set to false.
Declaration
public CsParameterDefaultValue DefaultValue { get; }
Property Value
Type | Description |
---|---|
CsParameterDefaultValue |
HasAttributes
Flag that determines if attributes are assigned.
Declaration
public bool HasAttributes { get; }
Property Value
Type | Description |
---|---|
bool |
HasDefaultValue
Flag that determines if the parameter has a default value.
Declaration
public bool HasDefaultValue { get; }
Property Value
Type | Description |
---|---|
bool |
IsGenericParameter
Flag that determines if the parameter is a generic place holder.
Declaration
public bool IsGenericParameter { get; }
Property Value
Type | Description |
---|---|
bool |
IsOptional
Flag that determines if the parameter is optional.
Declaration
public bool IsOptional { get; }
Property Value
Type | Description |
---|---|
bool |
IsOut
Flag that determines if the parameter is assigned the out keyword.
Declaration
public bool IsOut { get; }
Property Value
Type | Description |
---|---|
bool |
IsParams
Flag that determines if the parameter is an parameter array.
Declaration
public bool IsParams { get; }
Property Value
Type | Description |
---|---|
bool |
IsRef
Flag that determines if the parameter is assigned the ref keyword.
Declaration
public bool IsRef { get; }
Property Value
Type | Description |
---|---|
bool |
LookupPath
The fully qualified path for this model that can be used when searching the source for the model.
Declaration
public string LookupPath { get; }
Property Value
Type | Description |
---|---|
string |
Name
The name of the parameter.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
string |
ParameterType
The data type assigned to the parameter.
Declaration
public CsType ParameterType { get; }
Property Value
Type | Description |
---|---|
CsType |
Parent
The parent to the current model. This will return null if there is no parent for this model, or the parent could not be located.
Declaration
public CsModel Parent { get; }
Property Value
Type | Description |
---|---|
CsModel |
Explicit Interface Implementations
| Improve this Doc View SourceIDotNetAttributes.Attributes
The attributes assigned to this item. If the HasAttributes is false this will be an empty list.
Declaration
IReadOnlyList<IDotNetAttribute> IDotNetAttributes.Attributes { get; }
Returns
Type | Description |
---|---|
IReadOnlyList<IDotNetAttribute> |
IDotNetParameter.DefaultValue
The default value assigned to the parameter. This will be null if the HasDefaultValue property is set to false.
Declaration
IDotNetParameterDefaultValue IDotNetParameter.DefaultValue { get; }
Returns
Type | Description |
---|---|
IDotNetParameterDefaultValue |
IDotNetParameter.ParameterType
The data type assigned to the parameter.
Declaration
IDotNetType IDotNetParameter.ParameterType { get; }
Returns
Type | Description |
---|---|
IDotNetType |
IParent.Parent
The parent to the current model. This will return null if there is no parent for this model, or the parent could not be located.
Declaration
IDotNetModel IParent.Parent { get; }
Returns
Type | Description |
---|---|
IDotNetModel |