示例#1
0
        //  _mailViewForm.SomeEvent += new EventHandler(this.HandleSomeEvent);
        //public void HandleSomeEvent(object sender, EventArgs e)
        //{
        //}

        private void PopUpMail()
        {
            if (MailTab_Inbox)
            {
                if (gridviewMails.SelectedRows.Count > 0)
                {
                    string FromMail = gridviewMails.SelectedRows[0].Cells["ColFrom"].Value.ToString();
                    string Subject  = gridviewMails.SelectedRows[0].Cells["ColSubject"].Value.ToString();
                    string Msg      = gridviewMails.SelectedRows[0].Cells["ColMsg"].Value.ToString();
                    int    MsgId    = (int)gridviewMails.SelectedRows[0].Cells["ColMsgId"].Value;
                    string FileName = gridviewMails.SelectedRows[0].Cells["ColFileName"].Value.ToString();
                    MakeMailAsRead();
                    MailView _mailViewForm = new MailView(MsgId, false, FromMail, Subject, Msg, FileName, false);
                    _mailViewForm.ShowDialog();
                    LoadInboxMails();
                }
            }
            else if (MailTab_Draft)
            {
                if (gridviewMails.SelectedRows.Count > 0)
                {
                    string      FromMail     = gridviewMails.SelectedRows[0].Cells["ColTo"].Value.ToString();
                    string      Subject      = gridviewMails.SelectedRows[0].Cells["ColSubject"].Value.ToString();
                    string      Msg          = gridviewMails.SelectedRows[0].Cells["ColMsg"].Value.ToString();
                    int         MsgId        = (int)gridviewMails.SelectedRows[0].Cells["ColMsgId"].Value;
                    ComposeMail _composeMail = new ComposeMail(ComposeMail.Mailtype.DraftMail, FromMail, Subject, Msg, MsgId);
                    _composeMail.ShowDialog();
                }
            }
            else if (MailTab_SentMails)
            {
                if (gridviewMails.SelectedRows.Count > 0)
                {
                    string   FromMail      = gridviewMails.SelectedRows[0].Cells["ColTo"].Value.ToString();
                    string   Subject       = gridviewMails.SelectedRows[0].Cells["ColSubject"].Value.ToString();
                    string   Msg           = gridviewMails.SelectedRows[0].Cells["ColMsg"].Value.ToString();
                    int      MsgId         = (int)gridviewMails.SelectedRows[0].Cells["ColMsgId"].Value;
                    string   FileName      = gridviewMails.SelectedRows[0].Cells["ColFileName"].Value.ToString();
                    MailView _mailViewForm = new MailView(MsgId, true, FromMail, Subject, Msg, FileName, false);
                    _mailViewForm.ShowDialog();
                    LoadSentMails();
                }
            }
            else if (MailTab_Recycle)
            {
                this.Size = new System.Drawing.Size(1202, 757);
            }
        }
示例#2
0
        public void speechRecognitionWithDictationGrammar_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            SpeechSynthesizer synth = new SpeechSynthesizer();

            synth.SetOutputToDefaultAudioDevice();

            // MessageBox.Show(string.Format("you just told {0}",e.Result.Text));
            if (e.Result.Text.Trim().Contains("compose mail") ||
                e.Result.Text.Trim().Contains("Open compose Window") ||
                e.Result.Text.Trim().Contains("Open compose Window"))
            {
                ComposeMail composeMail = new ComposeMail(SpeechToText.ComposeMail.Mailtype.ComposeMail, "", "", "", 0);
                composeMail.ShowDialog();
                //DoAction(e.Result.Text);
            }
            else if (e.Result.Text.Trim().Contains("ok vmail can you read"))
            {
                DoAction(e.Result.Text);
            }
            else if (e.Result.Text.Trim().Contains("Open the draft"))
            {
                // DraftMailLoad();
            }
            else if (e.Result.Text.ToLower().Contains("Reply to this mail".ToLower()))
            {
                if (ChooseMail)
                {
                    MailView _mailViewForm = new MailView(FilterMail.MsgId, false, FilterMail.FromEmailId, FilterMail.Subject, FilterMail.Message, FilterMail.FileName, true);
                    _mailViewForm.Show();
                }
                else
                {
                    synth.Speak("Please read a mail before reply");
                }
            }
            else if (e.Result.Text.Trim().Contains("signout") || e.Result.Text.Trim().Contains("seven"))
            {
                Signout();
            }
            else
            {
                txtSearch.Text = e.Result.Text;
            }
        }
示例#3
0
        private void btnCompose_Click(object sender, EventArgs e)
        {
            ComposeMail composeMail = new ComposeMail(SpeechToText.ComposeMail.Mailtype.ComposeMail, "", "", "", 0);

            composeMail.ShowDialog();
        }