Exemplo n.º 1
0
        private TaskActionType objDownloadJob_TaskEnd(ITaskResult objTaskResult, int intIndex)
        {
            timerUpdateProgress.Enabled = false;

            TaskActionType enuTaskActionType = TaskActionType.Continue;

            if (objTaskResult.Result == TaskResultType.Failed)
            {
                enuTaskActionType = DownloadFailedMessage.ShowMessage(objTaskResult);
            }

            this.ThreadSafe(new MethodInvoker(delegate()
            {
                timerUpdateProgress.Enabled = false;

                UpdateOverallProgress(_intTaskCount, _intTaskIndex);

                ListViewItem objListViewItem = listViewStatus.Items[_intTaskIndex - 1];
                if (objListViewItem != null)
                {
                    objListViewItem.SubItems[1].Text = objTaskResult.Result.ToString();
                    listViewStatus.EnsureVisible(objListViewItem.Index);
                }

                UpdateCurrentProgress(progressBarCurrent.Maximum, progressBarCurrent.Maximum);
            }));

            _objCurrentDownloadStats = null;

            return(enuTaskActionType);
        }
Exemplo n.º 2
0
        public static TaskActionType ShowMessage(ITaskResult objTaskResult)
        {
            TaskActionType enuResult = default(TaskActionType);

            using (DownloadFailedMessage objDialog = new DownloadFailedMessage())
            {
                enuResult = objDialog.ShowDialogWithResult(objTaskResult);
            }

            return(enuResult);
        }