Class MethodMemberDescriptor
Class providing easier marshalling of CLR functions
Inherited Members
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 |
Returns
|
System.Boolean
|
Exceptions
|
System.ArgumentException
Thrown if throwException is |
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
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 |
|
System.Boolean
forceVisibility
if set to |
Returns
|
MethodMemberDescriptor
A new MethodMemberDescriptor or null. |