예제 #1
0
 private void FormEmailAddress_Load(object sender, System.EventArgs e)
 {
     if (EmailAddressCur != null)
     {
         textSMTPserver.Text = EmailAddressCur.SMTPserver;
         textUsername.Text   = EmailAddressCur.EmailUsername;
         if (!String.IsNullOrEmpty(EmailAddressCur.EmailPassword))                  //can happen if creating a new user email.
         {
             textPassword.Text = MiscUtils.Decrypt(EmailAddressCur.EmailPassword);
         }
         textPort.Text               = EmailAddressCur.ServerPort.ToString();
         checkSSL.Checked            = EmailAddressCur.UseSSL;
         textSender.Text             = EmailAddressCur.SenderAddress;
         textSMTPserverIncoming.Text = EmailAddressCur.Pop3ServerIncoming;
         textPortIncoming.Text       = EmailAddressCur.ServerPortIncoming.ToString();
     }
 }
예제 #2
0
 private void FormEmailAddress_Load(object sender, System.EventArgs e)
 {
     if (_emailAddressCur != null)
     {
         textSMTPserver.Text = _emailAddressCur.SMTPserver;
         textUsername.Text   = _emailAddressCur.EmailUsername;
         if (!String.IsNullOrEmpty(_emailAddressCur.EmailPassword))                  //can happen if creating a new user email.
         {
             textPassword.Text = MiscUtils.Decrypt(_emailAddressCur.EmailPassword);
         }
         textPort.Text               = _emailAddressCur.ServerPort.ToString();
         checkSSL.Checked            = _emailAddressCur.UseSSL;
         textSender.Text             = _emailAddressCur.SenderAddress;
         textSMTPserverIncoming.Text = _emailAddressCur.Pop3ServerIncoming;
         textPortIncoming.Text       = _emailAddressCur.ServerPortIncoming.ToString();
         //Both EmailNotifyAddressNum and EmailDefaultAddressNum could be 0 (unset), in which case we still may want to display the user.
         List <long> listDefaultAddressNums = new List <long>()
         {
             PrefC.GetLong(PrefName.EmailNotifyAddressNum),
             PrefC.GetLong(PrefName.EmailDefaultAddressNum)
         };
         if (_isNew || !_emailAddressCur.EmailAddressNum.In(listDefaultAddressNums))
         {
             Userod user = Userods.GetUser(_emailAddressCur.UserNum);
             textUserod.Tag  = user;
             textUserod.Text = user?.UserName;
         }
         else
         {
             groupUserod.Visible = false;
         }
         textAccessToken.Text  = _emailAddressCur.AccessToken;
         textRefreshToken.Text = _emailAddressCur.RefreshToken;
     }
     groupGoogleAuth.Visible = !textAccessToken.Text.IsNullOrEmpty();
     if (groupGoogleAuth.Visible)
     {
         groupAuthentication.Location = new Point(_groupAuthLocationXAuthorized, groupAuthentication.Location.Y);
     }
     else
     {
         groupAuthentication.Location = new Point(_groupAuthLocationXNotAuthorized, groupAuthentication.Location.Y);
     }
 }