Skip to content

Class PrecompiledMethodDescriptor<TTarget, TReturn>

Definition

Namespace: StardewUI.Framework.Descriptors
Assembly: StardewUI.dll

Statically-typed implementation of an IMethodDescriptor<T> with predefined attributes.

public class PrecompiledMethodDescriptor<TTarget, TReturn> : 
    StardewUI.Framework.Descriptors.IMethodDescriptor<TReturn>, 
    StardewUI.Framework.Descriptors.IMethodDescriptor, 
    StardewUI.Framework.Descriptors.IMemberDescriptor

Type Parameters

TTarget
The method's declaring type.

TReturn
The type of the method's return value.

Inheritance
Object ⇦ PrecompiledMethodDescriptor<TTarget, TReturn>

Implements
IMethodDescriptor<TReturn>, IMethodDescriptor, IMemberDescriptor

Members

Constructors

Name Description
PrecompiledMethodDescriptor<TTarget, TReturn>(string, Type, Object, Func<TTarget, Object, Object>) Statically-typed implementation of an IMethodDescriptor<T> with predefined attributes.

Properties

Name Description
ArgumentTypes The exact types expected for the method's arguments.
DeclaringType The type on which the member is declared.
Name The member name.
OptionalArgumentCount The number of optional arguments at the end of the argument list.
ReturnType The method's return type.

Methods

Name Description
Invoke(Object, Object) Invokes the underlying method.

Details

Constructors

PrecompiledMethodDescriptor<TTarget, TReturn>(string, Type, Object, Func<TTarget, Object, Object>)

Statically-typed implementation of an IMethodDescriptor<T> with predefined attributes.

public PrecompiledMethodDescriptor<TTarget, TReturn>(string name, System.Type argumentTypes, System.Object defaultValues, Func<TTarget, System.Object, System.Object> invoke);
Parameters

name   string
The method name.

argumentTypes   Type
Types of all method parameters, including optional parameters.

defaultValues   Object
Default values for all optional parameters at the end of the argument list.

invoke   Func<TTarget, Object, Object>
Function to invoke the method on a given target with a specified argument list.


Properties

ArgumentTypes

The exact types expected for the method's arguments.

public ReadOnlySpan<System.Type> ArgumentTypes { get; }
Property Value

ReadOnlySpan<Type>


DeclaringType

The type on which the member is declared.

public System.Type DeclaringType { get; }
Property Value

Type


Name

The member name.

public string Name { get; }
Property Value

string


OptionalArgumentCount

The number of optional arguments at the end of the argument list.

public int OptionalArgumentCount { get; }
Property Value

Int32

Remarks

Optional arguments can be provided with Missing in order to ignore them in the invocation.


ReturnType

The method's return type.

public System.Type ReturnType { get; }
Property Value

Type


Methods

Invoke(Object, Object)

Invokes the underlying method.

public TReturn Invoke(System.Object target, System.Object arguments);
Parameters

target   Object
The object instance on which to invoke the method.

arguments   Object
The arguments to provide to the method.

Returns

TReturn