public void OnTextEntered(MoonSharp.Interpreter.Closure handler) { TextEntered += (s) => { handler.Call(s); }; }
public void OnSelectedIndexChanged(MoonSharp.Interpreter.Closure handler) { SelectedIndexChanged += () => { handler.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())); }
// MoonSharp.Interpreter.Closure public void OnClick(MoonSharp.Interpreter.Closure callback) { buttonComponent.onClick.AddListener(() => callback.Call()); }