Example #1
0
 private void EndValidation(IAsyncResult result)
 {
     try
     {
         AsyncResult   ar = (AsyncResult)result;
         StartDelegate st = (StartDelegate)ar.AsyncDelegate;
         st.EndInvoke(ar);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.Fail(ex.Message, ex.ToString());
         throw ex;
     }
 }
Example #2
0
        /// <summary>
        ///     Callback function used when running StartAsync.
        /// </summary>
        /// <param name="asyncResult">
        ///     The AsyncResult.
        /// </param>
        private void startCallback(IAsyncResult asyncResult)
        {
            Exception     e             = null;
            StartDelegate startDelegate = (StartDelegate)asyncResult.AsyncState;

            try
            {
                startDelegate.EndInvoke(asyncResult);
            }
            catch (Exception ex)
            {
                e = ex;
            }
            OnProcessingCompleted(new AsyncCompletedEventArgs(e, asyncResult.IsCompleted, asyncResult.AsyncState));
        }