public void AddAccount(MobileAccount account) { if (!IsExistAccount(account)) { _storage.Add(account.ToString().GetHashCode(), account); } }
private void IncomingCall(MobileAccount from) { var existNumber = Contacts.Where(i => i.Account == from).ToArray(); Console.WriteLine("Incoming Call to {0}!", this); Console.WriteLine("From: {0}", existNumber.Length != 0 ? existNumber[0].Name : from.ToString()); }
private void IncomingSMS(MobileAccount from, string message) { var existNumber = Contacts.Where(i => i.Account == from).ToArray(); Console.WriteLine("{0} received SMS!", this); Console.WriteLine("From: {0}", existNumber.Length != 0 ? existNumber[0].Name : from.ToString()); Console.WriteLine("Text: {0}", message); }
public bool IsExistAccount(MobileAccount account) { return(_storage.ContainsKey(account.ToString().GetHashCode())); }
public void RemoveAccount(MobileAccount account) { _storage.Remove(account.ToString().GetHashCode()); }