protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter is InfomationDeliver info)
            {
                SendType = info.SendType;
                switch (info.SendType)
                {
                case EmailSendType.NormalSend:
                {
                    From                 = info.From;
                    ToWho.IsReadOnly     = false;
                    EmailText.IsReadOnly = false;
                    Insert.IsEnabled     = true;
                    break;
                }

                case EmailSendType.Reply:
                {
                    To                   = info.To;
                    From                 = info.From;
                    Title                = info.Title;
                    ToWho.IsReadOnly     = true;
                    EmailText.IsReadOnly = false;
                    Insert.IsEnabled     = true;
                    break;
                }

                case EmailSendType.ReplyToAll:
                {
                    To                   = info.To;
                    From                 = info.From;
                    Title                = info.Title;
                    ToWho.IsReadOnly     = true;
                    EmailText.IsReadOnly = false;
                    Insert.IsEnabled     = true;
                    break;
                }

                case EmailSendType.Forward:
                {
                    From                 = info.From;
                    Title                = info.Title;
                    ToWho.IsReadOnly     = false;
                    EmailText.IsReadOnly = true;
                    Insert.IsEnabled     = false;
                    break;
                }
                }
            }
            OnPropertyChanged();
        }
Beispiel #2
0
        public GmailSvc(EmailSendType sendType, string sendFromName = "")
        {
            switch (sendType)
            {
            case EmailSendType.System_NoReply:
                UserEmail = GSUIT_FROM_EMAIL_SYSTEM;
                FromName  = "Punnel";
                break;

            case EmailSendType.Lead_AutoReply:
                Random rnd = new Random();
                int    idx = rnd.Next(1, 2);
                UserEmail = SendFromMail[idx];
                FromName  = sendFromName;
                break;
            }
            Credential();
        }