Table of Contents

Class CallbackFunction

Namespace
MoonSharp.Interpreter
Assembly
Assembly-CSharp.dll
public sealed class CallbackFunction : RefIdObject
Inheritance
CallbackFunction
Inherited Members
Extension Methods

Constructors

CallbackFunction(Func<ScriptExecutionContext, CallbackArguments, DynValue>, string)

public CallbackFunction(Func<ScriptExecutionContext, CallbackArguments, DynValue> callBack, string name = null)

Parameters

callBack Func<ScriptExecutionContext, CallbackArguments, DynValue>
name string

Properties

AdditionalData

public object AdditionalData { get; set; }

Property Value

object

ClrCallback

public Func<ScriptExecutionContext, CallbackArguments, DynValue> ClrCallback { get; }

Property Value

Func<ScriptExecutionContext, CallbackArguments, DynValue>

DefaultAccessMode

public static InteropAccessMode DefaultAccessMode { get; set; }

Property Value

InteropAccessMode

Name

public string Name { get; }

Property Value

string

Methods

CheckCallbackSignature(MethodInfo, bool)

public static bool CheckCallbackSignature(MethodInfo mi, bool requirePublicVisibility)

Parameters

mi MethodInfo
requirePublicVisibility bool

Returns

bool

FromDelegate(Script, Delegate, InteropAccessMode)

public static CallbackFunction FromDelegate(Script script, Delegate del, InteropAccessMode accessMode = InteropAccessMode.Default)

Parameters

script Script
del Delegate
accessMode InteropAccessMode

Returns

CallbackFunction

FromMethodInfo(Script, MethodInfo, object, InteropAccessMode)

public static CallbackFunction FromMethodInfo(Script script, MethodInfo mi, object obj = null, InteropAccessMode accessMode = InteropAccessMode.Default)

Parameters

script Script
mi MethodInfo
obj object
accessMode InteropAccessMode

Returns

CallbackFunction

Invoke(ScriptExecutionContext, IList<DynValue>, bool)

public DynValue Invoke(ScriptExecutionContext executionContext, IList<DynValue> args, bool isMethodCall = false)

Parameters

executionContext ScriptExecutionContext
args IList<DynValue>
isMethodCall bool

Returns

DynValue