Class ConstantLoader<T>
Abstract class that defines an object capable of loading a constant value into the MSIL instruction sequence.
Inheritance
Inherited Members
Namespace: TheXDS.MCART.Types.Extensions.ConstantLoaders
Assembly: MCART.TypeFactory.dll
Syntax
public abstract class ConstantLoader<T> : IConstantLoader, IEquatable<IConstantLoader>
Type Parameters
| Name | Description |
|---|---|
| T | Type of constant to load. |
Properties
| Edit this page View SourceConstantType
Gets a reference to the constant type that this instance can load into the MSIL instruction sequence.
Declaration
public Type ConstantType { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Methods
| Edit this page View SourceCanLoadConstant(object?)
Indicates if the specified value can be loaded using this instance.
Declaration
public bool CanLoadConstant(object? value)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | Value to be loaded. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified value can be loaded using this instance, false otherwise. |
Emit(ILGenerator, object?)
Loads a constant value into the MSIL instruction sequence.
Declaration
public void Emit(ILGenerator il, object? value)
Parameters
| Type | Name | Description |
|---|---|---|
| ILGenerator | il | Code generator to use. |
| object | value | Constant value to load. Must be of type |
Emit(ILGenerator, T)
Loads a T constant value into the MSIL
instruction sequence.
Declaration
public abstract void Emit(ILGenerator il, T value)
Parameters
| Type | Name | Description |
|---|---|---|
| ILGenerator | il | The IL generator to use. |
| T | value | The constant value to load into the instruction sequence. |
Equals(IConstantLoader?)
Determines whether this instance and another IConstantLoader are equal based on the constant type that they can both load.
Declaration
public bool Equals(IConstantLoader? other)
Parameters
| Type | Name | Description |
|---|---|---|
| IConstantLoader | other | An instance of IConstantLoader to compare against. |
Returns
| Type | Description |
|---|---|
| bool | true if both IConstantLoader instances can load the same type of values, false otherwise. |