A dialog with a progress bar that runs and tracks the progress of an ITask.
Наследование: System.Windows.Forms.Form
Пример #1
0
        /// <inheritdoc/>
        public override void RunTask(ITask task)
        {
            #region Sanity checks
            if (task == null) throw new ArgumentNullException(nameof(task));
            #endregion

            Log.Debug("Task: " + task.Name);
            ApplicationUtils.Invoke(() =>
            {
                using (var dialog = new TaskRunDialog(task, CredentialProvider, CancellationTokenSource, _owner))
                {
                    dialog.Execute();
                    if (dialog.Exception != null) throw dialog.Exception.PreserveStack();
                }
            });
        }
Пример #2
0
        /// <inheritdoc/>
        public override void RunTask(ITask task)
        {
            #region Sanity checks
            if (task == null)
            {
                throw new ArgumentNullException(nameof(task));
            }
            #endregion

            Log.Debug("Task: " + task.Name);
            Exception ex = null;
            _owner.Invoke(() =>
            {
                using (var dialog = new TaskRunDialog(task, CredentialProvider, CancellationTokenSource))
                {
                    dialog.ShowDialog(_owner);
                    ex = dialog.Exception;
                }
            });
            if (ex != null)
            {
                throw ex.PreserveStack();
            }
        }