예제 #1
0
 private void OnNewMessageArrived(object sender, MessageHeaderViewModel newMessageHeaderViewModel)
 {
     Dispatcher.Invoke(() => {
         var balloon    = new NewMessageBalloon(newMessageHeaderViewModel);
         TaskbarIcon tb = Application.Current.Resources["TbIcon"] as TaskbarIcon;
         if (tb != null)
         {
             tb.ShowCustomBalloon(balloon, PopupAnimation.Fade, 10000);
         }
     });
 }
예제 #2
0
        public List <MessageHeaderViewModel> GetInbox()
        {
            var messages = new List <MessageHeaderViewModel>();

            for (int i = 0; i < 15; i++)
            {
                var headers    = pop3Client.GetMessageHeaders(i);
                var messHeader = new MessageHeaderViewModel
                {
                    Date  = headers[HeaderId.Date],
                    From  = headers[HeaderId.From],
                    Title = headers[HeaderId.Subject],
                    Id    = i
                };
                messages.Add(messHeader);
            }
            return(messages);
        }
예제 #3
0
 public NewMessageBalloon(MessageHeaderViewModel newMessageHeaderViewModel)
 {
     InitializeComponent();
     this.DataContext = newMessageHeaderViewModel;
 }