public static void AddAccount(QuikConnectionManager.Account obj) { if (!Accounts.Any(k => k.Id == obj.Id)) { Accounts.Add(new Entities.Account(obj.Name, obj.Id)); log.Info("New account added Id={0} Name={1}", obj.Id, obj.Name); } else { log.Warn("Trying to add existing account {0} {1}", obj.Id, obj.Name); } }
public static void UpdateAccount(QuikConnectionManager.Account obj) { try { //Accounts.First(k => k.Id == obj.Id).Name = obj.Name; //update account } catch (SystemException e) { log.Warn("Update on unknown account"); } }
static void ConnectionManager_OnAccount(Account obj) { Console.WriteLine("New Account"); }
private static void NotifyOnNewAccount(Account a) { if (OnNewAccount != null) { OnNewAccount(a); } }