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
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
typeNamestringQualified 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
typeTypeThe type.
Properties
CallTarget
Gets the call target.
protected override object CallTarget { get; }
Property Value
- object
The call target.
Exceptions
IsAvailable
Gets a value indicating whether this Type is available at runtime.
public bool IsAvailable { get; }
Property Value
- bool
trueif 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
typeNamestringThe type name to resolve. An assembly-qualified name is resolved without
assemblybeing supplied.assemblyAssemblyThe assembly to search, or
nullto resolve through the normal type-resolution rules.
Returns
- Type
The resolved type, or
nullif it could not be found. A malformed name, a missing or unloadable assembly, and a bad image also yieldnull. Any other exception propagates.