Esempio 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);
                }
            }
        }
Esempio 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);
                }
            }
        }