Class FunctionMemberDescriptorBase
Class providing easier marshalling of CLR functions
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public abstract class FunctionMemberDescriptorBase : IOverloadableMemberDescriptor
Properties
ExtensionMethodType
Gets the type which this extension method extends, null if this is not an extension method.
Declaration
public Type ExtensionMethodType { get; }
Property Value
|
Type
|
IsStatic
Gets a value indicating whether the described method is static.
Declaration
public bool IsStatic { get; }
Property Value
|
System.Boolean
|
MemberAccess
Gets the types of access supported by this member
Declaration
public MemberDescriptorAccess MemberAccess { get; }
Property Value
|
MemberDescriptorAccess
|
Name
Gets the name of the described method
Declaration
public string Name { get; }
Property Value
|
System.String
|
Parameters
Gets the type of the arguments of the underlying CLR function
Declaration
public ParameterDescriptor[] Parameters { get; }
Property Value
|
ParameterDescriptor[]
|
SortDiscriminant
Gets a sort discriminant to give consistent overload resolution matching in case of perfectly equal scores
Declaration
public string SortDiscriminant { get; }
Property Value
|
System.String
|
VarArgsArrayType
Gets a value indicating the type of the ParamArray parameter of a var-args function. If the function is not var-args, null is returned.
Declaration
public Type VarArgsArrayType { get; }
Property Value
|
Type
|
VarArgsElementType
Gets a value indicating the type of the elements of the ParamArray parameter of a var-args function. If the function is not var-args, null is returned.
Declaration
public Type VarArgsElementType { get; }
Property Value
|
Type
|
Methods
BuildArgumentList(Script, Object, ScriptExecutionContext, CallbackArguments, out List<Int32>)
Builds the argument list.
Declaration
protected virtual object[] BuildArgumentList(Script script, object obj, ScriptExecutionContext context, CallbackArguments args, out List<int> outParams)
Parameters
|
Script
script
The script. |
|
System.Object
obj
The object. |
|
ScriptExecutionContext
context
The context. |
|
CallbackArguments
args
The arguments. |
|
List<System.Int32>
outParams
Output: A list containing the indices of all "out" parameters, or null if no out parameters are specified. |
Returns
|
System.Object[]
The arguments, appropriately converted. |
BuildReturnValue(Script, List<Int32>, Object[], Object)
Builds the return value of a call
Declaration
protected static DynValue BuildReturnValue(Script script, List<int> outParams, object[] pars, object retv)
Parameters
|
Script
script
The script. |
|
List<System.Int32>
outParams
The out parameters indices, or null. See BuildArgumentList(Script, Object, ScriptExecutionContext, CallbackArguments, out List<Int32>). |
|
System.Object[]
pars
The parameters passed to the function. |
|
System.Object
retv
The return value from the function. Use DynValue.Void if the function returned no value. |
Returns
|
DynValue
A DynValue to be returned to scripts |
CreateCallbackDynValue(Script, MethodInfo, Object)
Creates a callback DynValue starting from a MethodInfo.
Declaration
public static DynValue CreateCallbackDynValue(Script script, MethodInfo mi, object obj = null)
Parameters
|
Script
script
The script. |
|
MethodInfo
mi
The mi. |
|
System.Object
obj
The object. |
Returns
|
DynValue
|
Execute(Script, Object, ScriptExecutionContext, CallbackArguments)
The internal callback which actually executes the method
Declaration
public abstract 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
|
GetCallback(Script, Object)
Gets a callback function as a delegate
Declaration
public Func<ScriptExecutionContext, CallbackArguments, DynValue> GetCallback(Script script, object obj = null)
Parameters
|
Script
script
The script for which the callback must be generated. |
|
System.Object
obj
The object (null for static). |
Returns
|
Func<ScriptExecutionContext, CallbackArguments, DynValue>
|
GetCallbackAsDynValue(Script, Object)
Gets the callback function as a DynValue.
Declaration
public DynValue GetCallbackAsDynValue(Script script, object obj = null)
Parameters
|
Script
script
The script for which the callback must be generated. |
|
System.Object
obj
The object (null for static). |
Returns
|
DynValue
|
GetCallbackFunction(Script, Object)
Gets the callback function.
Declaration
public CallbackFunction GetCallbackFunction(Script script, object obj = null)
Parameters
|
Script
script
The script for which the callback must be generated. |
|
System.Object
obj
The object (null for static). |
Returns
|
CallbackFunction
|
GetValue(Script, Object)
Gets the value of this member as a DynValue to be exposed to scripts.
Declaration
public virtual DynValue GetValue(Script script, object obj)
Parameters
|
Script
script
The script. |
|
System.Object
obj
The object owning this member, or null if static. |
Returns
|
DynValue
The value of this member as a DynValue. |
Initialize(String, Boolean, ParameterDescriptor[], Boolean)
Initializes this instance. This MUST be called by the constructors extending this class to complete initialization.
Declaration
protected void Initialize(string funcName, bool isStatic, ParameterDescriptor[] parameters, bool isExtensionMethod)
Parameters
|
System.String
funcName
Name of the function. |
|
System.Boolean
isStatic
if set to |
|
ParameterDescriptor[]
parameters
The parameters. |
|
System.Boolean
isExtensionMethod
if set to |