Table of Contents

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

type IType
name string

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 IType
name string
owner IParameterizedMember
attributes IReadOnlyList<IAttribute>
referenceKind ReferenceKind
isParams bool
isOptional bool
defaultValue object

Properties

HasConstantValueInSignature

public bool HasConstantValueInSignature { get; }

Property Value

bool

IsIn

Gets whether this parameter is a C# 'in' parameter.

public bool IsIn { get; }

Property Value

bool

IsOptional

Gets whether this parameter is optional. The default value is given by the GetConstantValue(bool) function.

public bool IsOptional { get; }

Property Value

bool

IsOut

Gets whether this parameter is a C# 'out' parameter.

public bool IsOut { get; }

Property Value

bool

IsParams

Gets whether this parameter is a C# 'params' parameter.

public bool IsParams { get; }

Property Value

bool

IsRef

Gets whether this parameter is a C# 'ref' parameter.

public bool IsRef { get; }

Property Value

bool

Lifetime

C# 11 scoped annotation.

public LifetimeAnnotation Lifetime { get; }

Property Value

LifetimeAnnotation

Name

Gets the name of the variable.

public string Name { get; }

Property Value

string

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

IParameterizedMember

ReferenceKind

Gets the reference kind of this parameter.

public ReferenceKind ReferenceKind { get; }

Property Value

ReferenceKind

Type

Gets the type of the variable.

public IType Type { get; }

Property Value

IType

Methods

GetAttributes()

Gets the attributes on this parameter.

public IEnumerable<IAttribute> GetAttributes()

Returns

IEnumerable<IAttribute>

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

object

ToString()

public override string ToString()

Returns

string

ToString(IParameter)

public static string ToString(IParameter parameter)

Parameters

parameter IParameter

Returns

string