Class DefaultParameter
- Namespace
- ICSharpCode.Decompiler.TypeSystem.Implementation
- Assembly
- ICSharpCode.Decompiler.dll
Default implementation of IParameter.
public sealed class DefaultParameter : IParameter, IVariable, ISymbol
- Inheritance
-
DefaultParameter
- Implements
- Inherited Members
- Extension Methods
Constructors
DefaultParameter(IType, string)
public DefaultParameter(IType type, string name)
Parameters
DefaultParameter(IType, string, IParameterizedMember, IReadOnlyList<IAttribute>, ReferenceKind, bool, bool, object)
public DefaultParameter(IType type, string name, IParameterizedMember owner = null, IReadOnlyList<IAttribute> attributes = null, ReferenceKind referenceKind = ReferenceKind.None, bool isParams = false, bool isOptional = false, object defaultValue = null)
Parameters
type
ITypename
stringowner
IParameterizedMemberattributes
IReadOnlyList<IAttribute>referenceKind
ReferenceKindisParams
boolisOptional
booldefaultValue
object
Properties
HasConstantValueInSignature
public bool HasConstantValueInSignature { get; }
Property Value
IsIn
Gets whether this parameter is a C# 'in' parameter.
public bool IsIn { get; }
Property Value
IsOptional
Gets whether this parameter is optional. The default value is given by the GetConstantValue(bool) function.
public bool IsOptional { get; }
Property Value
IsOut
Gets whether this parameter is a C# 'out' parameter.
public bool IsOut { get; }
Property Value
IsParams
Gets whether this parameter is a C# 'params' parameter.
public bool IsParams { get; }
Property Value
IsRef
Gets whether this parameter is a C# 'ref' parameter.
public bool IsRef { get; }
Property Value
Lifetime
C# 11 scoped annotation.
public LifetimeAnnotation Lifetime { get; }
Property Value
Name
Gets the name of the variable.
public string Name { get; }
Property Value
Owner
Gets the owner of this parameter. May return null; for example when parameters belong to lambdas or anonymous methods.
public IParameterizedMember Owner { get; }
Property Value
ReferenceKind
Gets the reference kind of this parameter.
public ReferenceKind ReferenceKind { get; }
Property Value
Type
Gets the type of the variable.
public IType Type { get; }
Property Value
Methods
GetAttributes()
Gets the attributes on this parameter.
public IEnumerable<IAttribute> GetAttributes()
Returns
GetConstantValue(bool)
If this field is a constant, retrieves the value. For parameters, this is the default value.
public object GetConstantValue(bool throwOnInvalidMetadata)
Parameters
throwOnInvalidMetadata
bool
Returns
ToString()
public override string ToString()
Returns
ToString(IParameter)
public static string ToString(IParameter parameter)
Parameters
parameter
IParameter