示例#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();
        }
示例#2
0
 protected abstract void DoWorkCore(LongOperation longOperation);