/// <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(); } }); }
/// <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(); } }