Table of Contents

Class DefaultVariable

Namespace
ICSharpCode.Decompiler.TypeSystem.Implementation
Assembly
ICSharpCode.Decompiler.dll

Default implementation of IVariable.

public sealed class DefaultVariable : IVariable, ISymbol
Inheritance
DefaultVariable
Implements
Inherited Members

Constructors

DefaultVariable(IType, string)

public DefaultVariable(IType type, string name)

Parameters

type IType
name string

DefaultVariable(IType, string, bool, object)

public DefaultVariable(IType type, string name, bool isConst = false, object constantValue = null)

Parameters

type IType
name string
isConst bool
constantValue object

Properties

IsConst

Gets whether this variable is a constant (C#-like const).

public bool IsConst { get; }

Property Value

bool

Name

Gets the name of the variable.

public string Name { get; }

Property Value

string

SymbolKind

This property returns an enum specifying which kind of symbol this is (which derived interfaces of ISymbol are implemented)

public SymbolKind SymbolKind { get; }

Property Value

SymbolKind

Type

Gets the type of the variable.

public IType Type { get; }

Property Value

IType

Methods

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