public NotificationToastViewModel(MessageFilterEventArgs e, Window w) { this.Network = e.Network; this.Channel = e.Channel; this.TimeStamp = e.Timestamp; this.User = e.Name; this.Message = e.Message; this.SV = (ShellView)w; }
/// <summary> /// Notifies the user by making the taskbar icon blink. /// </summary> /// <param name="args">Contains the channel, user, etc. of the important message</param> public void Notify(MessageFilterEventArgs args) { Window x = screen.GetView() as Window; x.Dispatcher.Invoke(DispatcherPriority.Background, new ThreadStart(delegate { IntPtr h = new WindowInteropHelper(x).Handle; TaskbarBlink.Flash(h); })); }
/// <summary> /// Notifies the user by displaying a toast in the bottom right corner /// </summary> /// <param name="e">Contains the channel, user, etc. of the important message</param> public void Notify(MessageFilterEventArgs e) { Window x = screen.GetView() as Window; var ntvm = new NotificationToastViewModel(e, x); x.Dispatcher.Invoke(DispatcherPriority.Background, new ThreadStart(delegate { this.windowManager.ShowWindow(ntvm); })); }
/// <summary> /// Plays sound to notify the user of an important message /// </summary> /// <param name="args"></param> public void Notify(MessageFilterEventArgs args) { if (this.settings.SoundPath != "") { try { ExtendedSoundPlayer sp = new ExtendedSoundPlayer(this.settings.SoundPath); sp.PlaySound(); } catch (FileNotFoundException ex) { Console.WriteLine(ex.ToString()); } } else { Console.WriteLine("Keine Sounddatei ausgewählt"); } }