Example #1
0
 public static void AddAccount(Account account)
 {
     if (!LoggedInAccounts.Contains(account))
     {
         LoggedInAccounts.QueueItem(account);
     }
     // Now make sure we are all connected still
 }
Example #2
0
 public static void RemoveAccountByClient(Account account)
 {
     Task task = Task.Factory.StartNew(() =>
     {
         try
         {
             int found = -1;
             // First remove this account
             for (int i = 0; i < LoggedInAccounts.Count; i++)
             {
                 if (LoggedInAccounts[i] == account)
                 {
                     found = i;
                 }
             }
             if (found != -1)
             {
                 RemoveID(account.AccountId);
                 LoggedInAccounts.RemoveAt(found);
             }
         }
         catch (Exception ex) { Console.WriteLine("Remove acct " + ex.Message); }
     });
 }