Exemplo n.º 1
0
        void ReportEndProcess()
        {
            timeEnd = DateTime.Now;

            StopAllProcess();

            if (currentProcess == ProcessType.Export)
            {
                ReportProgress();
                if (ExportCompleted != null)
                {
                    ExportCompleteArgs arg = new ExportCompleteArgs(timeStart, timeEnd, processCompletionType, _lastError);
                    ExportCompleted(this, arg);
                }
            }
            else if (currentProcess == ProcessType.Import)
            {
                _currentBytes = _totalBytes;

                ReportProgress();
                if (ImportCompleted != null)
                {
                    ImportCompleteArgs arg = new ImportCompleteArgs();
                    ImportCompleted(this, arg);
                }
            }
        }
Exemplo n.º 2
0
        void ReportEndProcess()
        {
            timeEnd = DateTime.Now;

            StopAllProcess();

            if (currentProcess == ProcessType.Export)
            {
                ReportProgress();
                if (ExportCompleted != null)
                {
                    ExportCompleteArgs arg = new ExportCompleteArgs(timeStart, timeEnd, processCompletionType, _lastError);
                    ExportCompleted(this, arg);
                }
            }
            else if (currentProcess == ProcessType.Import)
            {
                _currentBytes = _totalBytes;

                ReportProgress();
                if (ImportCompleted != null)
                {
                    ImportCompleteArgs.CompleteType completedType;
                    switch (processCompletionType)
                    {
                    case ProcessEndType.Complete:
                        completedType = ImportCompleteArgs.CompleteType.Completed;
                        break;

                    case ProcessEndType.Error:
                        completedType = ImportCompleteArgs.CompleteType.Error;
                        break;

                    case ProcessEndType.Cancelled:
                        completedType = ImportCompleteArgs.CompleteType.Cancelled;
                        break;

                    default:
                        completedType = ImportCompleteArgs.CompleteType.UnknownStatus;
                        break;
                    }

                    ImportCompleteArgs arg = new ImportCompleteArgs()
                    {
                        LastError     = _lastError,
                        CompletedType = completedType,
                        TimeStart     = timeStart,
                        TimeEnd       = timeEnd,
                    };
                    ImportCompleted(this, arg);
                }
            }
        }
Exemplo n.º 3
0
        private void ReportEndProcess()
        {
            _timeEnd = DateTime.Now;

            StopAllProcess();

            switch (_currentProcess)
            {
            case ProcessType.Export:
            {
                ReportProgress();
                if (ExportCompleted == null)
                {
                    return;
                }
                var arg = new ExportCompleteArgs(_timeStart, _timeEnd, _processCompletionType, LastError);
                ExportCompleted(this, arg);
                break;
            }

            case ProcessType.Import:
            {
                _currentBytes = _totalBytes;

                ReportProgress();
                if (ImportCompleted == null)
                {
                    return;
                }
                var arg = new ImportCompleteArgs();
                ImportCompleted(this, arg);
                break;
            }

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 4
0
        void ReportEndProcess()
        {
            timeEnd = DateTime.Now;

            StopAllProcess();

            if (currentProcess == ProcessType.Export)
            {
                ReportProgress();
                if (ExportCompleted != null)
                {
                    ExportCompleteArgs arg = new ExportCompleteArgs(timeStart, timeEnd, processCompletionType, _lastError);
                    ExportCompleted(this, arg);
                }
            }
            else if (currentProcess == ProcessType.Import)
            {
                _currentBytes = _totalBytes;

                ReportProgress();
                if (ImportCompleted != null)
                {
                    ImportCompleteArgs arg = new ImportCompleteArgs();
                    ImportCompleted(this, arg);
                }
            }
        }