private void ItemsActivated() { foreach (ViewMailItem i in cList.SelectedItems) { if (i.Draft != null) { OpenDraft(i.Draft as DraftMessageSource); continue; } MailViewWindow window = new MailViewWindow(); window.Item = new MailNavigationNode(GetClient().MailView, i); window.Show(); } }
private void mClient_AccountNotification(object sender, AccountNotificationEventArgs args) { if (Settings.Default.SupressNotificationsClient && IsEveClientRunning()) { return; } if (Settings.Default.SupressNotificationsFullscreen && ServiceConnection.IsFullscreenAppRunning) { return; } if (args.NewMails != null) { mLog.Info($"{args.NewMails.Length} new mails notifications"); if (args.NewMails.Length > 2) { Notification notify = new Notification() { ImageUrl = args.ForAccount.ImageUrl.ImageUrlToUri(UriKind.Absolute), SoundUrl = "@://Sound/NewMails.wav".SoundUrlToUri(UriKind.Absolute), Title = string.Format("{0} new Eve-Mails for character {1}", args.NewMails.Length, args.ForAccount.UserName) }; notify.NotificationActivated += (o, e) => Client.Commands.SendCommand("ShowWindow", args.ForAccount.Id.ToString()); notify.Show(); } else { EventHandler openmail = delegate(object nsender, EventArgs e) { Notification n = nsender as Notification; var mail = n.ContextData as ViewMailItem; MailNavigationNode node = new MailNavigationNode(mail); MailView.MailViewWindow window = new MailView.MailViewWindow() { Item = node }; window.Show(); mail.IsItemRead = true; Client.SaveMailMetaData(mail); }; foreach (var item in args.NewMails) { var notify = new Notification() { Title = item.MailSubject, Line1 = item.From.Name, Line2 = args.ForAccount.UserName, SoundUrl = "@://Sound/NewMail.wav".SoundUrlToUri(UriKind.Absolute), ContextData = item }; if (item.From.Type == EntityType.Mailinglist) { notify.ImageUrl = item.From.ImageUrl128.ImageUrlToUri(UriKind.Absolute); } else { notify.ImageUrl = new Uri(item.From.ImageUrl128); } notify.NotificationActivated += openmail; notify.Show(); } } } }