Class DuckGenerator

Type generator for creating a proxy that wraps the Target to implement the Interface.

Inheritance
System.Object
TypeEmitter
Generator
DuckGenerator
Inherited Members
Generator.GenerateId(String, IEnumerable<Type>)
Generator.ActivateAsync(ITuple, CancellationToken)
Generator.GetGeneratedTypeAsync(CancellationToken)
Generator.GetGeneratedType()
Generator.Id
Namespace: Solti.Utils.Proxy.Generators
Assembly: Solti.Utils.Proxy.dll
Syntax
public sealed class DuckGenerator : Generator

Constructors

DuckGenerator(Type, Type)

Type generator for creating a proxy that wraps the Target to implement the Interface.

Declaration
public DuckGenerator(Type iface, Type target)
Parameters
Type Name Description
System.Type iface
System.Type target

Properties

Interface

The interface for which the proxy will be created.

Declaration
public Type Interface { get; }
Property Value
Type Description
System.Type

Target

The target implementing all the Interface members.

Declaration
public Type Target { get; }
Property Value
Type Description
System.Type

Methods

Activate(Object)

Activates the underlying duck type.

Declaration
public object Activate(object target)
Parameters
Type Name Description
System.Object target
Returns
Type Description
System.Object

ActivateAsync(Object, CancellationToken)

Activates the underlying duck type.

Declaration
public Task<object> ActivateAsync(object target, CancellationToken cancellation = null)
Parameters
Type Name Description
System.Object target
System.Threading.CancellationToken cancellation
Returns
Type Description
System.Threading.Tasks.Task<System.Object>
In This Article
Back to top Generated by DocFX