System.Delegate.DynamicInvoke C# (CSharp) Method

DynamicInvoke() public method

public DynamicInvoke ( ) : object
return object
        public object DynamicInvoke(params object[] args)
        {
            return Jsni.apply(this.As<JsObject>(), this.As<JsObject>(), args.As<JsArray>());
        }
    }

Usage Example

Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DelayedInvoke"/> class.
 /// </summary>
 /// <param name="action">The action to perform.</param>
 /// <param name="timeout">The timeout before running.</param>
 /// <param name="blocking">if set to <c>true</c> then the delay will block.</param>
 /// <param name="args">The arguments to pass to the action.</param>
 public DelayedInvoke(Delegate action, int timeout, bool blocking, object[] args = null)
 {
     if (timeout == 0)
     {
         action.DynamicInvoke(args);
     }
     if (blocking)
     {
         do
         {
             Restart = false;
             Thread.Sleep(timeout);
         } while (Restart);
         HasReturned = true;
         ReturnValue = action.DynamicInvoke(args);
     }
     else
     {
         thread = new Thread(delegate()
         {
             do
             {
                 Restart = false;
                 Thread.Sleep(timeout);
             } while (Restart);
             HasReturned = true;
             ReturnValue = action.DynamicInvoke(args);
         });
         thread.Name = "DelayedInvoke: " + action.Method.Name;
         thread.Start();
     }
 }
All Usage Examples Of System.Delegate::DynamicInvoke