Пример #1
0
 public void Encrypt_Decrypt_ShouldReturnSame()
 {
     CredentialServiceObject.SaveCredentials("test1", "test2");
     string[] expected = new string[] { "test1", "test2" };
     string[] actual   = CredentialServiceObject.GetSavedCredentials();
     Assert.AreEqual(expected, actual);
 }
Пример #2
0
 internal bool SignInWithCredentials()
 {
     string[] credentials = CredentialServiceObject.GetSavedCredentials();
     if (credentials != null)
     {
         _email    = credentials[0];
         _password = credentials[1];
         SignIn(Email, Password);
         return(true);
     }
     return(false);
 }
Пример #3
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     string[] cred = CredentialServiceObject.GetSavedCredentials();
     if (cred == null || cred.Length != 2)
     {
         CreateLoginForm();
     }
     else
     {
         try
         {
             IMAPService IMAPServiceObject = AttemptLogin(cred);
             CreateMainWindow(IMAPServiceObject);
         }
         catch (ArgumentException)
         {
             CreateLoginForm();
         }
     }
 }