private void NotifyNewMessage(string Message) { try { NewMessages++; if (ConfigManager.Instance.GetBool("sound_notifications", true) && ConfigManager.Instance.GetBool("sound_newmessagenotification", true)) { SoundManager.NewMessageSound.Play(); } if (ConfigManager.Instance.GetBool("txt_notifications", true) && ConfigManager.Instance.GetBool("txt_newmessagenotification", true)) { System.Windows.Controls.RichTextBox rtf = new System.Windows.Controls.RichTextBox(); rtf.Selection.Load(new MemoryStream(System.Text.Encoding.Default.GetBytes(Message.Replace("xmlns=\"default\"", "xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\""))), DataFormats.Xaml); NotificationWindow.ShowNotification(string.Format("New Message From {0}", NickName), rtf.Selection.Text); } WindowExtensions.FlashWindow(MainWindow.Instance); } catch { } }
private void wnd_GotFocus(object sender, RoutedEventArgs e) { WindowExtensions.StopFlashingWindow(this); }