public Task <TaskDialogResult> ShowAsync() { var context = SynchronizationContext.Current; if (context == null) { return(Task.FromResult(MethodImpl())); } else { var taskCompletionSource = new TaskCompletionSource <TaskDialogResult>(); context.Post(state => { try { taskCompletionSource.SetResult(MethodImpl()); } catch (TaskCanceledException) { taskCompletionSource.SetCanceled(); } catch (Exception ex) { taskCompletionSource.SetException(ex); } }, null); return(taskCompletionSource.Task); } TaskDialogResult MethodImpl() { var result = ActiveTaskDialog.Show(this, out int button, out int radioButton, out bool verificationFlagChecked); ClickedButton = null; SelectedRadioButton = null; if (CurrentPage.clrButtons.TryGetValue(button, out TaskButton clickedButton)) { ClickedButton = clickedButton; } if (CurrentPage.clrRadioButtons.TryGetValue(radioButton, out TaskRadioButton selectedRadioButton)) { SelectedRadioButton = selectedRadioButton; } VerificationFlagChecked = verificationFlagChecked; return(result); } }
public TaskDialogResult DoModal(IntPtr hWnd) { var result = ActiveTaskDialog.DoModal(this, hWnd, out int button, out int radioButton, out bool verificationFlagChecked); ClickedButton = null; SelectedRadioButton = null; if (CurrentPage.clrButtons.TryGetValue(button, out TaskButton clickedButton)) { ClickedButton = clickedButton; } if (CurrentPage.clrRadioButtons.TryGetValue(radioButton, out TaskRadioButton selectedRadioButton)) { SelectedRadioButton = selectedRadioButton; } VerificationFlagChecked = verificationFlagChecked; return(result); }
public TaskDialogExpandButtonEventArgs(ActiveTaskDialog activeTaskDialog, bool expanded) : base(activeTaskDialog) { Expanded = expanded; }
internal void OnClick(ActiveTaskDialog activeTaskDialog) { TaskDialogEventArgs eventArgs = new TaskDialogEventArgs(activeTaskDialog); Click?.Invoke(this, eventArgs); }
public TaskDialogEventArgs(ActiveTaskDialog activeTaskDialog) { ActiveTaskDialog = activeTaskDialog; }
public TaskDialogVerificationEventArgs(ActiveTaskDialog activeTaskDialog, bool checkedValue) : base(activeTaskDialog) { Checked = checkedValue; }
public TaskButtonClickEventArgs(ActiveTaskDialog activeTaskDialog, bool dialogClose) : base(activeTaskDialog) { CancelDialogClose = dialogClose; }
public TaskDialogTimerEventArgs(ActiveTaskDialog activeTaskDialog, uint tickCount, bool resetTickCount) : base(activeTaskDialog) { TickCount = tickCount; ResetTickCount = resetTickCount; }
public TaskDialogHyperlinkEventArgs(ActiveTaskDialog activeTaskDialog, string href) : base(activeTaskDialog) { Href = href; }
protected internal virtual void OnNavigated(ActiveTaskDialog activeTaskDialog) { Navigated?.Invoke(this, new TaskDialogEventArgs(activeTaskDialog)); }
protected internal virtual void OnDialogConstructed(ActiveTaskDialog activeTaskDialog) { DialogConstructed?.Invoke(this, new TaskDialogEventArgs(activeTaskDialog)); }