Class Generator
Base of untyped generators.
Namespace: Solti.Utils.Proxy.Internals
Assembly: Solti.Utils.Proxy.dll
Syntax
public abstract class Generator : TypeEmitter
Constructors
Generator(Object)
Creates a new Generator instance.
Declaration
protected Generator(object id)
Parameters
Type | Name | Description |
---|---|---|
System.Object | id |
Properties
Id
Unique generator id. Generators emitting the same output should have the same id.
Declaration
public object Id { get; }
Property Value
Type | Description |
---|---|
System.Object |
Methods
Activate(ITuple)
Creates an instance of the generated type.
Declaration
public object Activate(ITuple tuple)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.CompilerServices.ITuple | tuple | A System.Tuple containing the constructor parameters or null if you want to invoke the parameterless constructor. |
Returns
Type | Description |
---|---|
System.Object | The just activated instance. |
ActivateAsync(ITuple, CancellationToken)
Creates an instance of the generated type.
Declaration
public Task<object> ActivateAsync(ITuple tuple, CancellationToken cancellation = null)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.CompilerServices.ITuple | tuple | A System.Tuple containing the constructor parameters or null if you want to invoke the parameterless constructor. |
System.Threading.CancellationToken | cancellation | Token to cancel the operation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Object> | The just activated instance. |
GetGeneratedType()
Gets the generated System.Type.
Declaration
public Type GetGeneratedType()
Returns
Type | Description |
---|---|
System.Type |
Remarks
The returned System.Type is generated only once.
GetGeneratedTypeAsync(CancellationToken)
Gets the generated System.Type asynchronously .
Declaration
public Task<Type> GetGeneratedTypeAsync(CancellationToken cancellation = null)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellation |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Type> |
Remarks
The returned System.Type is generated only once.