Metalama 1.0 / / Metalama Documentation / Aspect API / Metalama.​Framework.​Code / Typed­Constant

Class TypedConstant

Represents a typed value that can be defined, defined to null, or undefined. Used to represent default values, for instance DefaultValue, or custom attribute arguments.

Inheritance
TypedConstant
Implements
IExpression
IHasType
Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public sealed class TypedConstant : ValueType, IExpression, IHasType

Properties

Name Description
IsInitialized

Gets a value indicating whether the Value has been specified (including when it is set to null).

IsNullOrDefault

Gets a value indicating whether the value is null or default. Not to be confused with IsInitialized.

Type

Gets the type of the value. This is important if the type is an enum, because in this case, if the enum type is not compile-time, Value is set to the underlying integer value.

Value

Gets the default value.

Values

Methods

Name Description
Create(Object)
Create(Object, IType)
Create(Object, Type)
CreateUnchecked(Object, IType)
Default(IType)
Default(Type)
ToString()

Explicit Interface Implementations

Name Description
IExpression.IsAssignable
IExpression.Value
IHasType.RefKind