public void OnSelectedIndexChanged(MoonSharp.Interpreter.Closure handler) { SelectedIndexChanged += () => { handler.Call(); }; }
public void OnTextEntered(MoonSharp.Interpreter.Closure handler) { TextEntered += (s) => { handler.Call(s); }; }
public virtual GenericAction AddAction(string eventName, MoonSharp.Interpreter.Closure closure) { GenericAction action = new GenericAction(closure); EnsureEventExists(eventName); OnActionAdded(eventName, action); actions[eventName].Add(action); return(action); }
public virtual void AddAction(string eventName, MoonSharp.Interpreter.Closure closure) { Action action = new Action(closure); actions.Add(eventName, action); }
internal void RegisterClosure(Closure closure) { _childClosures.Add(new WeakReference(closure)); }
internal DynValue Recycle(Processor mainProcessor, Closure closure) { Type = CoroutineType.Recycled; return(m_Processor.Coroutine_Recycle(mainProcessor, closure)); }
// MoonSharp.Interpreter.Closure public void OnClick(MoonSharp.Interpreter.Closure callback) { buttonComponent.onClick.AddListener(() => callback.Call()); }
/// <summary> /// Asynchronously calls this function with the specified args /// /// This method is supported only on .NET 4.x and .NET 4.x PCL targets. /// </summary> /// <param name="function">The function.</param> /// <param name="args">The arguments to pass to the function.</param> /// <returns></returns> /// <exception cref="System.ArgumentException">Thrown if function is not of DataType.Function</exception> public static Task <DynValue> CallAsync(this Closure function, params DynValue[] args) { return(ExecAsync(() => function.Call(args))); }
/// <summary> /// Asynchronously calls this function with the specified args /// /// This method is supported only on .NET 4.x and .NET 4.x PCL targets. /// </summary> /// <param name="function">The function.</param> /// <returns></returns> /// <exception cref="System.ArgumentException">Thrown if function is not of DataType.Function</exception> public static Task <DynValue> CallAsync(this Closure function) { return(ExecAsync(() => function.Call())); }