Table of Contents

Interface IParameter

Namespace
ICSharpCode.Decompiler.TypeSystem
Assembly
ICSharpCode.Decompiler.dll
public interface IParameter : IVariable, ISymbol
Inherited Members
Extension Methods

Properties

HasConstantValueInSignature

Gets whether this parameter has a constant value when presented in method signature.

bool HasConstantValueInSignature { get; }

Property Value

bool

Remarks

This can only be true if the parameter is optional, and it's true for most optional parameters. However it is possible to compile a parameter without a default value, and some parameters handle their default values in an special way.

For example, DecimalConstantAttribute does not use normal constants, so when DecimalConstants is false we expose DecimalConstantAttribute directly instead of a constant value.

On the call sites, though, we can still use the value inferred from the attribute.

IsIn

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

bool IsIn { get; }

Property Value

bool

IsOptional

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

bool IsOptional { get; }

Property Value

bool

IsOut

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

bool IsOut { get; }

Property Value

bool

IsParams

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

bool IsParams { get; }

Property Value

bool

IsRef

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

bool IsRef { get; }

Property Value

bool

Lifetime

C# 11 scoped annotation.

LifetimeAnnotation Lifetime { get; }

Property Value

LifetimeAnnotation

Owner

Gets the owner of this parameter. May return null; for example when parameters belong to lambdas or anonymous methods.

IParameterizedMember? Owner { get; }

Property Value

IParameterizedMember

ReferenceKind

Gets the reference kind of this parameter.

ReferenceKind ReferenceKind { get; }

Property Value

ReferenceKind

Methods

GetAttributes()

Gets the attributes on this parameter.

IEnumerable<IAttribute> GetAttributes()

Returns

IEnumerable<IAttribute>