本文整理汇总了C#中Engine.CallFunction方法的典型用法代码示例。如果您正苦于以下问题:C# Engine.CallFunction方法的具体用法?C# Engine.CallFunction怎么用?C# Engine.CallFunction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Engine
的用法示例。
在下文中一共展示了Engine.CallFunction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CallFunction
private object CallFunction(object child, string function, object[] args, Engine engine)
{
engine.SetContext(null);
if (Script != null) engine.ExecuteScript(Script, CodeTree);
Functions.Execute(engine);
return engine.CallFunction(function, args);
}
示例2: Call
public static object Call(string path, CodeTree codeTree, string staticMethodName, string methodName, string functionName, BuiltinFunction builtinFunction, Type type, ExpressionCollection typeArguments, IEnumerable<object> args, Engine engine)
{
if (path != null)
return engine.CallPath(path, codeTree, args);
if (functionName != null)
return engine.CallFunction(functionName, args);
if (builtinFunction != 0)
return engine.CallBuiltinFunction(builtinFunction, args);
var typeArgs = typeArguments.Count != 0 ? typeArguments.Get(engine).Cast<Type>().ToArray() : null;
if (staticMethodName != null)
return CallHelper.CallMethod(staticMethodName, true, type, null, args, typeArgs, engine);
if (methodName != null)
return CallHelper.CallMethod(methodName, false, type ?? engine.Context.GetType(), engine.Context, args, typeArgs, engine);
return engine.Throw("nothing to call");
}
示例3: OnCall
public override object OnCall(Engine engine, IEnumerable<object> args)
{
return engine.CallFunction(FunctionName, GetArguments(engine, args));
}