Table of Contents

Class LateType

Namespace
Dynamitey.DynamicObjects
Assembly
Dynamitey.Community.dll

Late bind types from libraries not not at compile type

public class LateType : BaseForwarder, IDynamicMetaObjectProvider, IEquivalentType, IForwarder
Inheritance
LateType
Implements
Inherited Members

Constructors

LateType(Assembly, string)

Initializes a new instance of the LateType class.

[RequiresUnreferencedCode("Calls FindType, which resolves typeName via Assembly.GetType/Type.GetType, a name-based type lookup the trimmer cannot see.")]
[RequiresDynamicCode("Constructing any BaseForwarder-derived type instantiates System.Dynamic.DynamicObject, whose default constructor requires the DLR's runtime code generation; not supported when AOT-compiled.")]
public LateType(Assembly assembly, string typeName)

Parameters

assembly Assembly

The assembly.

typeName string

Name of the type.

LateType(string)

Initializes a new instance of the LateType class.

[RequiresUnreferencedCode("Calls FindType, which resolves typeName via Assembly.GetType/Type.GetType, a name-based type lookup the trimmer cannot see.")]
[RequiresDynamicCode("Constructing any BaseForwarder-derived type instantiates System.Dynamic.DynamicObject, whose default constructor requires the DLR's runtime code generation; not supported when AOT-compiled.")]
public LateType(string typeName)

Parameters

typeName string

Qualified Name of the type.

LateType(Type)

Initializes a new instance of the LateType class.

[RequiresDynamicCode("Constructing any BaseForwarder-derived type instantiates System.Dynamic.DynamicObject, whose default constructor requires the DLR's runtime code generation; not supported when AOT-compiled.")]
public LateType(Type type)

Parameters

type Type

The type.

Properties

CallTarget

Gets the call target.

protected override object CallTarget { get; }

Property Value

object

The call target.

Exceptions

LateType.MissingTypeException

IsAvailable

Gets a value indicating whether this Type is available at runtime.

public bool IsAvailable { get; }

Property Value

bool

true if this instance is available; otherwise, false.

new

Returns a late bound constructor

public dynamic @new { get; }

Property Value

dynamic

The late bound constructor

Methods

FindType(string, Assembly?)

Resolves a type by name, returning null rather than throwing when it cannot be found.

[RequiresUnreferencedCode("Resolves typeName via Assembly.GetType/Type.GetType, both name-based type lookups the trimmer cannot see; a type this depends on can be removed. Returns null instead of throwing when the type can't be found.")]
public static Type? FindType(string typeName, Assembly? assembly = null)

Parameters

typeName string

The type name to resolve. An assembly-qualified name is resolved without assembly being supplied.

assembly Assembly

The assembly to search, or null to resolve through the normal type-resolution rules.

Returns

Type

The resolved type, or null if it could not be found. A malformed name, a missing or unloadable assembly, and a bad image also yield null. Any other exception propagates.