private void ToastDismissed(ToastNotification sender, ToastDismissedEventArgs e) { var tag = sender.Tag; var resetEvent = _events[tag]; resetEvent.Set(); }
private void OnDismissed(ToastNotification sender, ToastDismissedEventArgs args) { System.Windows.Application.Current.Dispatcher.Invoke(delegate() { System.Windows.MessageBox.Show("OnDismissed:: Reason = " + args.Reason); }); }
async void toast_Dismissed(ToastNotification sender, ToastDismissedEventArgs args) { await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { // info.Text = "Toast通知消失:" + args.Reason.ToString(); }); }
private static void ToastNotif_Dismissed(ToastNotification sender, ToastDismissedEventArgs args) { if (args.Reason == ToastDismissalReason.UserCanceled || args.Reason == ToastDismissalReason.TimedOut) { ToastNotificationManager.CreateToastNotifier().Hide(sender); } }
private void ToastDismissed(ToastNotification sender, ToastDismissedEventArgs e) { String outputText = ""; switch (e.Reason) { case ToastDismissalReason.ApplicationHidden: outputText = "The app hid the toast using ToastNotifier.Hide"; break; case ToastDismissalReason.UserCanceled: outputText = "The user dismissed the toast"; break; case ToastDismissalReason.TimedOut: outputText = "The toast has timed out"; break; } Dispatcher.Invoke(() => { // Title = outputText; }); }
private static void ToastDismissed(ToastNotification sender, ToastDismissedEventArgs e) { String outputText = ""; int exitCode = -1; switch (e.Reason) { case ToastDismissalReason.ApplicationHidden: outputText = "Hidden"; exitCode = 1; break; case ToastDismissalReason.UserCanceled: outputText = "Dismissed"; exitCode = 2; break; case ToastDismissalReason.TimedOut: outputText = "Timeout"; exitCode = 3; break; } Console.WriteLine(outputText); Environment.Exit(exitCode); }
private void OnDismissed(ToastNotification sender, ToastDismissedEventArgs e) { var found = _notifications.TryGetValue(sender.Tag, out var notification); // TODO: When remove notification from our collections? //_notifications.Remove(sender.Tag); //_toasts.Remove(sender.Tag); if (!found) { return; } notification.Dismiss(); }
async void toast_Dismissed(ToastNotification sender, ToastDismissedEventArgs e) { switch (e.Reason) { case ToastDismissalReason.UserCanceled: this.CurrentReminderStation.alertResponse = true; break; case ToastDismissalReason.ApplicationHidden: case ToastDismissalReason.TimedOut: this.CurrentReminderStation.alertDisplaying = false; break; } }
private void Dismiss(ToastNotification n, ToastDismissedEventArgs o) { ToastNotificationManager.CreateToastNotifier().Update(Notification.Data, NotificationTag); /*NotificationTag += "_"; * Notification = new ToastNotification(ToastContent.GetXml()) * { * Priority = ToastNotificationPriority.High, * Tag = NotificationTag, * Group = NotificationGroup * }; * Notification.SuppressPopup = true; * Notification.Dismissed += Dismiss; * ToastNotificationManager.CreateToastNotifier().Show(Notification);*/ }
private void Toast_Dismissed(ToastNotification sender, ToastDismissedEventArgs e) { switch (e.Reason) { case ToastDismissalReason.ApplicationHidden: tcs.SetResult(ToastResult.ApplicationHidden); break; case ToastDismissalReason.UserCanceled: tcs.SetResult(ToastResult.UserCanceled); break; case ToastDismissalReason.TimedOut: tcs.SetResult(ToastResult.TimedOut); break; } }
private void Toast_Dismissed(ToastNotification sender, ToastDismissedEventArgs args) { //String outputText = ""; //switch (args.Reason) //{ // case ToastDismissalReason.ApplicationHidden: // outputText = "The app hid the toast using ToastNotifier.Hide"; // break; // case ToastDismissalReason.UserCanceled: // outputText = "The user dismissed the toast"; // break; // case ToastDismissalReason.TimedOut: // outputText = "The toast has timed out"; // break; //} //MessageBox.Show(outputText); }
/// <summary> /// Event handler when the toast notifcation is dismissed /// </summary> /// <param name="source"> Holds the details of the toast being dismissed </param> /// <param name="e"> Holds the details of how was the toast dismissed </param> private static void ToastDismissed(object source, ToastDismissedEventArgs e) { Console.WriteLine("Start Toast Dismissed"); // Logs the reason for the dismissal of the toast Console.WriteLine("Toast Dismissed with reason {0}", e.Reason); switch (e.Reason) { case ToastDismissalReason.ApplicationHidden: break; case ToastDismissalReason.UserCanceled: break; case ToastDismissalReason.TimedOut: break; } Console.WriteLine("End Toast Dismissed"); }
private void ToastNotificationOnDismissed(ToastNotification sender, ToastDismissedEventArgs args) { if (!_notifications.TryGetValue(sender, out var notification)) { return; } _notifications.Remove(sender); var reason = args.Reason switch { ToastDismissalReason.UserCanceled => NotificationDismissReason.User, ToastDismissalReason.TimedOut => NotificationDismissReason.Expired, ToastDismissalReason.ApplicationHidden => NotificationDismissReason.Application, _ => throw new ArgumentOutOfRangeException() }; NotificationDismissed?.Invoke(this, new NotificationDismissedEventArgs(notification, reason)); }
private static void ToastDismissed(object source, ToastDismissedEventArgs e) { switch (e.Reason) { case ToastDismissalReason.ApplicationHidden: // Application hid the toast with ToastNotifier.Hide Debug.WriteLine("Application Hidden"); break; case ToastDismissalReason.UserCanceled: Debug.WriteLine("User dismissed the toast"); break; case ToastDismissalReason.TimedOut: Debug.WriteLine("Toast timeout elapsed"); break; } Debug.WriteLine("Toast Dismissed: " + e.Reason.ToString()); }
private static void ToastDismissed(ToastNotification sender, ToastDismissedEventArgs e) { string outputText = ""; switch (e.Reason) { case ToastDismissalReason.ApplicationHidden: outputText = "The app hide the toast using ToastNotifier.Hide"; break; case ToastDismissalReason.UserCanceled: outputText = "The user dismissed the toast"; break; case ToastDismissalReason.TimedOut: outputText = "The toast has timed out"; break; } Console.WriteLine(outputText); }
private void ToastNotification_Dismissed(ToastNotification sender, ToastDismissedEventArgs args) { _result = Result.Dismissed; switch (args.Reason) { case ToastDismissalReason.ApplicationHidden: _result = Result.Dismissed_ApplicationHidden; break; case ToastDismissalReason.TimedOut: _result = Result.Dismissed_Timeout; break; case ToastDismissalReason.UserCanceled: _result = Result.Dismissed_UserCanceled; break; } _manualResetEventSlim.Set(); }
/// <summary> /// Triggered when the notification has been dismissed. /// </summary> /// <param name="sender">ToastNotification sender object.</param> /// <param name="e">Toast dismissed event arguments.</param> internal void Dismissed(ToastNotification sender, ToastDismissedEventArgs e) { switch (e.Reason) { case ToastDismissalReason.ApplicationHidden: WriteLine("The notification has been closed."); Exit((int)DismissalActions.Hidden); break; case ToastDismissalReason.UserCanceled: WriteLine("The user dismissed this toast."); Exit((int)DismissalActions.Dismissed); break; case ToastDismissalReason.TimedOut: WriteLine("The toast has timed out."); Exit((int)DismissalActions.Timeout); break; } }
private void ToastDismissed(ToastNotification sender, ToastDismissedEventArgs e) { //String outputText = ""; //switch (e.Reason) //{ // case ToastDismissalReason.ApplicationHidden: // outputText = "The app hid the toast using ToastNotifier.Hide"; // break; // case ToastDismissalReason.UserCanceled: // outputText = "The user dismissed the toast"; // break; // case ToastDismissalReason.TimedOut: // outputText = "The toast has timed out"; // break; //} //Dispatcher.Invoke(() => //{ // Output.Text = outputText; //}); }
private void ToastDismissed(ToastNotification sender, ToastDismissedEventArgs e) { var outputText = ""; switch (e.Reason) { case ToastDismissalReason.ApplicationHidden: outputText = "The app hid the toast using ToastNotifier.Hide"; break; case ToastDismissalReason.UserCanceled: outputText = "The user dismissed the toast"; break; case ToastDismissalReason.TimedOut: outputText = "The toast has timed out"; break; } DisplayToastStatus(outputText); }
private void toastDismissed(ToastNotification sender, ToastDismissedEventArgs e) { String outputText = ""; switch (e.Reason) { case ToastDismissalReason.ApplicationHidden: outputText = "The app hid the toast using ToastNotifier.Hide"; break; case ToastDismissalReason.UserCanceled: outputText = "The user dismissed the toast"; break; case ToastDismissalReason.TimedOut: outputText = "The toast has timed out"; break; } //TODO: react to toast, either in a messaging service or the toast itself }
async void toast_Dismissed(ToastNotification sender, ToastDismissedEventArgs e) { String outputText = ""; switch (e.Reason) { case ToastDismissalReason.ApplicationHidden: outputText = "The app hid the toast using ToastNotifier.Hide(toast)"; break; case ToastDismissalReason.UserCanceled: outputText = "The user dismissed this toast"; break; case ToastDismissalReason.TimedOut: outputText = "The toast has timed out"; break; } await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { rootPage.NotifyUser(outputText, NotifyType.StatusMessage); }); }
private void Toast_Dismissed(ToastNotification sender, ToastDismissedEventArgs args) { NewToastNotification.OpenBrowser("http://vtc.org.vn/"); }
protected virtual void OnDismissed(ToastNotification sender, ToastDismissedEventArgs args) { Dismissed?.Invoke(sender, args); }
private void Toast_Dismissed(ToastNotification sender, ToastDismissedEventArgs args) { _clock.Resume(); }
private static void ToastDismissed(ToastNotification sender, ToastDismissedEventArgs args) => throw new NotImplementedException();
private void ToastOnDismissed(ToastNotification toastNotification, ToastDismissedEventArgs args) { var tagString = toastNotification.Tag; ToastNotificationManager.History.Remove(tagString); }
private void Toast_Dismissed(Windows.UI.Notifications.ToastNotification sender, ToastDismissedEventArgs args) { var id = sender.Tag; var options = _notificationOptions[id]; if (args.Reason != ToastDismissalReason.UserCanceled && options.AllowTapInNotificationCenter) { return; } switch (args.Reason) { case ToastDismissalReason.ApplicationHidden: _eventResult.Add(id, new NotificationResult() { Action = NotificationAction.ApplicationHidden }); break; case ToastDismissalReason.TimedOut: _eventResult.Add(id, new NotificationResult() { Action = NotificationAction.Timeout }); break; case ToastDismissalReason.UserCanceled: default: _eventResult.Add(id, new NotificationResult() { Action = NotificationAction.Dismissed }); break; } if (_notificationOptions.ContainsKey(id)) { if (options.ClearFromHistory) { ToastNotificationManager.History.Remove(id); } _notificationOptions.Remove(id); } _resetEvents[id].Set(); }
void Toast_Dismissed(ToastNotification sender, ToastDismissedEventArgs args) => GenerateQuickAction();
private void Toast_Dismissed(Windows.UI.Notifications.ToastNotification sender, ToastDismissedEventArgs args) { #if WINDOWS_UWP var id = sender.Tag; #else var id = _toasts.Single(x => x.Value == sender).Key; #endif switch (args.Reason) { case ToastDismissalReason.ApplicationHidden: _eventResult.Add(id, new NotificationResult() { Action = NotificationAction.ApplicationHidden }); break; case ToastDismissalReason.TimedOut: _eventResult.Add(id, new NotificationResult() { Action = NotificationAction.Timeout }); break; case ToastDismissalReason.UserCanceled: default: _eventResult.Add(id, new NotificationResult() { Action = NotificationAction.Dismissed }); break; } _resetEvents[id].Set(); }
private void ToastDismissed(ToastNotification sender, ToastDismissedEventArgs args) { }