Example #1
0
        private void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            _runContext   = null;
            _token.Worker = null;
            _token        = null;

            if (e.Error != null)
            {
                if (_runContext.OnError != null)
                {
                    _runContext.OnError();
                }
            }
            else if (e.Cancelled)
            {
                if (_runContext.OnCancelled != null)
                {
                    _runContext.OnCancelled();
                }
            }
            else
            {
                if (_runContext.OnSuccess != null)
                {
                    _runContext.OnSuccess(e.Result);
                }
            }
        }