protected void OnCallback(TaskDialogNotificationArgs e) { if (_Options.Callback != null) { HandleCallbackReturn(e, _Options.Callback(this, e, _Options.CallbackData)); } }
/// <summary> /// Notifies any callback handlers that the dialog is destroyed. /// </summary> public void NotifyClosed() { var args = new TaskDialogNotificationArgs(); args.Config = _Options; args.Notification = TaskDialogNotification.Destroyed; OnCallback(args); }
/// <summary> /// Notifies any callback handlers that the dialog has been created but not yet shown. /// </summary> public void NotifyCreated() { var args = new TaskDialogNotificationArgs(); args.Config = _Options; args.Notification = TaskDialogNotification.Created; _OnCallback(args); }
void CallbackTimer_Tick(object sender, EventArgs e) { var args = new TaskDialogNotificationArgs(); args.Config = _Options; args.Notification = TaskDialogNotification.Timer; args.TimerTickCount = Convert.ToUInt32(Math.Round(DateTime.Now.Subtract(_CallbackTimerStart).TotalMilliseconds, 0)); OnCallback(args); }
void HandleCallbackReturn(TaskDialogNotificationArgs e, bool returnValue) { switch (e.Notification) { default: // all others // Return value ignored according to MSDN break; case TaskDialogNotification.ButtonClicked: // TRUE : prevent dialog from closing _PreventClose = returnValue; break; case TaskDialogNotification.Timer: // TRUE : reset tickcount if (returnValue) { _CallbackTimerStart = DateTime.Now; } break; } }