Class Invocation
- Namespace
- Dynamitey
- Assembly
- Dynamitey.Community.dll
Storable representation of an invocation without the target
public class Invocation
- Inheritance
-
Invocation
- Derived
- Inherited Members
Constructors
Invocation(InvocationKind, String_OR_InvokeMemberName?, params object?[]?)
Initializes a new instance of the Invocation class.
public Invocation(InvocationKind kind, String_OR_InvokeMemberName? name, params object?[]? storedArgs)
Parameters
kindInvocationKindThe kind.
nameString_OR_InvokeMemberNameThe name.
storedArgsobject[]The args.
Fields
ConstructorBinderName
De facto Binder Name for Constructor
public static readonly string ConstructorBinderName
Field Value
ExplicitConvertBinderName
De facto Binder Name for Explicit Convert Op
public static readonly string ExplicitConvertBinderName
Field Value
ImplicitConvertBinderName
De facto Binder Name for Implicit Convert Op
public static readonly string ImplicitConvertBinderName
Field Value
IndexBinderName
De facto Binder Name for Indexer
public static readonly string IndexBinderName
Field Value
Properties
Args
Gets or sets the args. null when constructed with no stored args (e.g. CreateConvert(Type, bool)'s default); individual elements may themselves be null - any argument value including null is valid.
public object?[]? Args { get; protected set; }
Property Value
- object[]
The args.
Kind
Gets or sets the kind.
public InvocationKind Kind { get; protected set; }
Property Value
- InvocationKind
The kind.
Name
Gets or sets the name. null for a Kind - such as Convert or Invoke - that doesn't need a member name.
public String_OR_InvokeMemberName? Name { get; protected set; }
Property Value
- String_OR_InvokeMemberName
The name.
Methods
Create(InvocationKind, String_OR_InvokeMemberName?, params object?[]?)
Creates the invocation.
public static Invocation Create(InvocationKind kind, String_OR_InvokeMemberName? name, params object?[]? storedArgs)
Parameters
kindInvocationKindThe kind.
nameString_OR_InvokeMemberNameThe name.
storedArgsobject[]The args.
Returns
Equals(Invocation?)
Determines whether the specified Invocation is equal to this instance.
public bool Equals(Invocation? other)
Parameters
otherInvocationThe other.
Returns
- bool
truewhen both describe the same call: the same Kind and Name, and argument lists that match by content.
Equals(object?)
Determines whether the specified object is equal to this instance.
public override bool Equals(object? obj)
Parameters
Returns
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
Invoke(object, params object?[]?)
Invokes the invocation on specified target with specific args.
[RequiresUnreferencedCode("Dispatches to a Dynamic.Invoke*/InvokeMember/InvokeGet/etc. method based on Kind, each of which resolves a member via the DLR binder; trimming can remove the member being resolved.")]
[RequiresDynamicCode("Every Kind dispatches through the DLR, which requires runtime code generation; not supported when AOT-compiled.")]
public virtual object? Invoke(object target, params object?[]? args)
Parameters
Returns
InvokeWithStoredArgs(object)
Invokes the invocation on specified target.
[RequiresUnreferencedCode("Calls Invoke, which resolves a member via the DLR binder; trimming can remove the member being resolved.")]
[RequiresDynamicCode("Calls Invoke, which requires the DLR's runtime code generation; not supported when AOT-compiled.")]
public virtual object? InvokeWithStoredArgs(object target)
Parameters
targetobjectThe target.