Exemple #1
0
        protected void StartLongOperation()
        {
            waitLongOperationCompleted = AsyncOperationManager.CreateOperation(null);
            LongOperation longOperation = new LongOperation(DoWork);

            longOperation.CancellingTimeoutMilliSeconds = 10000;
            longOperation.CancellingTimeoutExpired     += new EventHandler(LongOperation_CancellingTimeoutExpired);
            longOperation.Completed += new EventHandler <LongOperationCompletedEventArgs>(LongOperation_Completed);

            progressControl = CreateProgressControl();
            progressControl.ShowProgress(longOperation);
            longOperation.StartAsync();
            OnOperationStarted();
        }
Exemple #2
0
 protected abstract void DoWorkCore(LongOperation longOperation);