Пример #1
0
        void ReportCompletion(IAsyncResult asyncResult)
        {
            System.Runtime.Remoting.Messaging.AsyncResult ar = (System.Runtime.Remoting.Messaging.AsyncResult)asyncResult;

            DoWorkEventHandler del;

            del = (DoWorkEventHandler)ar.AsyncDelegate;

            DoWorkProviderEventArgs doWorkArgs = (DoWorkProviderEventArgs)ar.AsyncState;

            object result = null;

            Exception error = null;

            try
            {
                del.EndInvoke(asyncResult);

                result = doWorkArgs.Result;
            }

            catch (Exception exception)
            {
                error = exception;
            }

            RunWorkerCompletedProviderEventArgs completedArgs = new RunWorkerCompletedProviderEventArgs(result, error, doWorkArgs.Cancel);

            OnRunWorkerCompleted(completedArgs);
        }
Пример #2
0
        public void RunWorkerAsync(object argument)
        {
            m_CancelPending = false;

            if (DoWork != null)
            {
                DoWorkProviderEventArgs args = new DoWorkProviderEventArgs(argument);
                AsyncCallback           callback;

                callback = new AsyncCallback(ReportCompletion);
                DoWork.BeginInvoke(this, args, callback, args);
            }
        }
Пример #3
0
 abstract public Movie LoadMovie(XmlDocument _movieXml, BackgroundWorker worker, DoWorkProviderEventArgs e);
Пример #4
0
 abstract public Movie LoadMovie(XmlNode movieNode, BackgroundWorker worker, DoWorkProviderEventArgs e);