public void Invoke (AsyncOperation methodCall, int timeout) { methodCall.Aborted = false; methodCall.Manager = this; lock (operationsToCancel) { operationsToCancel.Add (methodCall); methodCall.Invoke (); } if (timeout != -1) { if (!methodCall.WaitForCompleted (timeout)) { bool wasAborted = methodCall.Aborted; methodCall.InternalAbort (); lock (operationsToCancel) { operationsToCancel.Remove (methodCall); ST.Monitor.PulseAll (operationsToCancel); } if (wasAborted) throw new EvaluatorException ("Aborted."); else throw new TimeOutException (); } } else { methodCall.WaitForCompleted (System.Threading.Timeout.Infinite); } lock (operationsToCancel) { operationsToCancel.Remove (methodCall); ST.Monitor.PulseAll (operationsToCancel); if (methodCall.Aborted) { throw new EvaluatorException ("Aborted."); } } if (!string.IsNullOrEmpty (methodCall.ExceptionMessage)) { throw new Exception (methodCall.ExceptionMessage); } }
public void AsyncExecute (AsyncOperation operation, int timeout) { asyncOperationManager.Invoke (operation, timeout); }
public void LeaveBusyState(AsyncOperation oper) { BusyStateEventArgs args = new BusyStateEventArgs (); args.IsBusy = false; args.Description = oper.Description; if (BusyStateChanged != null) BusyStateChanged (this, args); }
public void AsyncExecute(AsyncOperation operation, int timeout) { asyncOperationManager.Invoke(operation, timeout); }