示例#1
0
 private void ReadMail()
 {
     if (SpeechModule.GetStatus())
     {
         synth.SetOutputToDefaultAudioDevice();
         MailServer  mailserver = new MailServer();
         List <Mail> listmails  = mailserver.ReceivedMailsList(LoginCredentials.LoggedEmailId);
         if (listmails != null)
         {
             bool UnreadCount = listmails.Any(X => X.IsRead == 0);
             if (UnreadCount)
             {
                 synth.SetOutputToDefaultAudioDevice();
                 synth.Speak("You have some unread mails");
                 synth.Speak("I will read one by one for you");
                 IEnumerable <Mail> Unreadmails = listmails.Where(X => X.IsRead == 0);
                 int k = 0;
                 foreach (var Msg in Unreadmails)
                 {
                     k++;
                     synth.Speak("Message " + k.ToString());
                     synth.Speak("From " + Msg.FromEmailId);
                     synth.Speak("Subject" + Msg.Subject);
                     synth.Speak("Message " + Msg.Message);
                     MailServer.MarkMsgAsRead(Msg.MsgId);
                     LoadInboxMails();
                 }
             }
             else
             {
                 synth.Speak("You dont have any unread mails");
             }
         }
     }
 }
示例#2
0
 private void MakeMailAsRead()
 {
     if (gridviewMails.SelectedRows.Count > 0)
     {
         MailServer.MarkMsgAsRead((int)gridviewMails.SelectedRows[0].Cells["ColMsgId"].Value);
         gridviewMails.SelectedRows[0].DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular);
     }
 }