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