示例#1
0
 public void RemoveUsername(string username)
 {
     if (Usernames.Remove(username))
     {
         if (CurrentUsername == username)
         {
             CurrentUsername = string.Empty;
         }
         CacheableType <string> accountDataCache = getAccountDataCache(username);
         accountDataCache.SetValue(string.Empty);
         KeyChainCacheableString credentialDataCache = getCredentialDataCache(username);
         credentialDataCache.SetValue(string.Empty);
         saveUsernames();
     }
 }
示例#2
0
 public RememberMeService()
 {
     rememberedUsernamesKeyChain = new KeyChainCacheableString("cp.rememberme", "");
     currentUsernameKeyChain     = new KeyChainCacheableString("cp.remembermecurrent", "");
     try
     {
         Usernames       = Service.Get <JsonService>().Deserialize <List <string> >(rememberedUsernamesKeyChain.GetValue());
         CurrentUsername = currentUsernameKeyChain.GetValue();
         validateStoredUsernames();
     }
     catch
     {
     }
     if (Usernames == null)
     {
         Usernames = new List <string>();
     }
     Service.Get <EventDispatcher>().AddListener <SessionEvents.SessionStartedEvent>(onSessionStarted);
     Service.Get <EventDispatcher>().AddListener <SessionEvents.SessionLogoutEvent>(onLogout);
     Service.Get <MixLoginCreateService>().OnSoftLoginFailed += onSoftLoginFailed;
 }