Пример #1
0
 protected virtual void OnWorkFinished(ProgressFinishedEventArgs e)
 {
     if (WorkFinished != null)
     {
         System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(WorkFinished, this, e);
     }
 }
Пример #2
0
        private void ProgressService_OnProgressFinished(object sender, ProgressFinishedEventArgs e)
        {
            var succeedCount = e.Steps - (e.Steps - (e.CurrentStep + 1)) - e.FailedSteps;
            Tools.Output += string.Format(
                "Operation finished : {0} Total, {1} Succeed, {2} Failed.\n\n",
                e.Steps, succeedCount, e.FailedSteps);

            _progressService.WorkFinished -= ProgressService_OnProgressFinished;
        }
Пример #3
0
 public void EndWork()
 {
     var eventArgs = new ProgressFinishedEventArgs()
     {
         Steps = _steps,
         CurrentStep = _currentStep,
         FailedSteps = _failedSteps
     };
     if (!IsFinished)
         OnWorkFinished(eventArgs);
 }
Пример #4
0
        public void EndWork()
        {
            var eventArgs = new ProgressFinishedEventArgs()
            {
                Steps       = _steps,
                CurrentStep = _currentStep,
                FailedSteps = _failedSteps
            };

            if (!IsFinished)
            {
                OnWorkFinished(eventArgs);
            }
        }
Пример #5
0
        public void NextStep()
        {
            var lastStep = _steps - 1;

            if (_currentStep < lastStep)
            {
                _currentStep++;
            }
            else
            {
                throw new Exception("Progress is finished!!");
            }

            if (IsFinished)
            {
                var eventArgs = new ProgressFinishedEventArgs()
                {
                    Steps       = _steps,
                    CurrentStep = _currentStep,
                    FailedSteps = _failedSteps
                };
                OnWorkFinished(eventArgs);
            }
        }
 protected virtual void OnWorkFinished(ProgressFinishedEventArgs e)
 {
     if (WorkFinished != null)
         System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(WorkFinished, this, e);
 }
 private void ProgressService_OnWorkFinished(object sender, ProgressFinishedEventArgs e)
 {
     OnWorkFinished(e);
     _lastWork.WorkFinished -= ProgressService_OnWorkFinished;
 }
Пример #8
0
 private void ProgressService_OnWorkFinished(object sender, ProgressFinishedEventArgs e)
 {
     OnWorkFinished(e);
     _lastWork.WorkFinished -= ProgressService_OnWorkFinished;
 }
Пример #9
0
        public void NextStep()
        {
            var lastStep = _steps - 1;
            if (_currentStep < lastStep)
                _currentStep++;
            else
                throw new Exception("Progress is finished!!");

            if (IsFinished)
            {
                var eventArgs = new ProgressFinishedEventArgs()
                {
                    Steps = _steps,
                    CurrentStep = _currentStep,
                    FailedSteps = _failedSteps
                };
                OnWorkFinished(eventArgs);
            }
        }