Show / Hide Table of Contents

Class MethodMemberDescriptor

Class providing easier marshalling of CLR functions

Inheritance
System.Object
FunctionMemberDescriptorBase
MethodMemberDescriptor
Inherited Members
FunctionMemberDescriptorBase.IsStatic
FunctionMemberDescriptorBase.Name
FunctionMemberDescriptorBase.SortDiscriminant
FunctionMemberDescriptorBase.Parameters
FunctionMemberDescriptorBase.ExtensionMethodType
FunctionMemberDescriptorBase.VarArgsArrayType
FunctionMemberDescriptorBase.VarArgsElementType
FunctionMemberDescriptorBase.Initialize(String, Boolean, ParameterDescriptor[], Boolean)
FunctionMemberDescriptorBase.GetCallback(Script, Object)
FunctionMemberDescriptorBase.GetCallbackFunction(Script, Object)
FunctionMemberDescriptorBase.GetCallbackAsDynValue(Script, Object)
FunctionMemberDescriptorBase.CreateCallbackDynValue(Script, MethodInfo, Object)
FunctionMemberDescriptorBase.BuildArgumentList(Script, Object, ScriptExecutionContext, CallbackArguments, List<Int32>)
FunctionMemberDescriptorBase.BuildReturnValue(Script, List<Int32>, Object[], Object)
FunctionMemberDescriptorBase.MemberAccess
FunctionMemberDescriptorBase.GetValue(Script, Object)
FunctionMemberDescriptorBase.SetValue(Script, Object, DynValue)
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public class MethodMemberDescriptor : FunctionMemberDescriptorBase, IOptimizableDescriptor, IWireableDescriptor

Constructors

MethodMemberDescriptor(MethodBase, InteropAccessMode)

Initializes a new instance of the MethodMemberDescriptor class.

Declaration
public MethodMemberDescriptor(MethodBase methodBase, InteropAccessMode accessMode = InteropAccessMode.Default)
Parameters
MethodBase methodBase

The MethodBase (MethodInfo or ConstructorInfo) got through reflection.

InteropAccessMode accessMode

The interop access mode.

Exceptions
System.ArgumentException

Invalid accessMode

Properties

AccessMode

Gets the access mode used for interop

Declaration
public InteropAccessMode AccessMode { get; }
Property Value
InteropAccessMode

IsConstructor

Gets a value indicating whether the described method is a constructor

Declaration
public bool IsConstructor { get; }
Property Value
System.Boolean

MethodInfo

Gets the method information (can be a MethodInfo or ConstructorInfo)

Declaration
public MethodBase MethodInfo { get; }
Property Value
MethodBase

Methods

CheckMethodIsCompatible(MethodBase, Boolean)

Checks if the method is compatible with a standard descriptor

Declaration
public static bool CheckMethodIsCompatible(MethodBase methodBase, bool throwException)
Parameters
MethodBase methodBase

The MethodBase.

System.Boolean throwException

if set to true an exception with the proper error message is thrown if not compatible.

Returns
System.Boolean

Exceptions
System.ArgumentException

Thrown if throwException is true and one of this applies: The method contains unresolved generic parameters, or has an unresolved generic return type or The method contains pointer parameters, or has a pointer return type

Execute(Script, Object, ScriptExecutionContext, CallbackArguments)

The internal callback which actually executes the method

Declaration
public override DynValue Execute(Script script, object obj, ScriptExecutionContext context, CallbackArguments args)
Parameters
Script script

The script.

System.Object obj

The object.

ScriptExecutionContext context

The context.

CallbackArguments args

The arguments.

Returns
DynValue

Overrides
FunctionMemberDescriptorBase.Execute(Script, Object, ScriptExecutionContext, CallbackArguments)

PrepareForWiring(Table)

Prepares the descriptor for hard-wiring. The descriptor fills the passed table with all the needed data for hardwire generators to generate the appropriate code.

Declaration
public void PrepareForWiring(Table t)
Parameters
Table t

The table to be filled

TryCreateIfVisible(MethodBase, InteropAccessMode, Boolean)

Tries to create a new MethodMemberDescriptor, returning null in case the method is not visible to script code.

Declaration
public static MethodMemberDescriptor TryCreateIfVisible(MethodBase methodBase, InteropAccessMode accessMode, bool forceVisibility = false)
Parameters
MethodBase methodBase

The MethodBase.

InteropAccessMode accessMode

The InteropAccessMode

System.Boolean forceVisibility

if set to true forces visibility.

Returns
MethodMemberDescriptor

A new MethodMemberDescriptor or null.

Back to top Built by Itinero, MIT licensed.