void SendNamesToAll() { foreach (KeyValuePair <string, IReceiveChatService> name in names) { IReceiveChatService proxy = name.Value; proxy.SendNames(names.Keys.ToList()); } ChatListOfNames?.Invoke(names.Keys.ToList(), this); }
private void AddUser(string name, IReceiveChatService callback) { names.Add(name, callback); ChatListOfNames?.Invoke(names.Keys.ToList(), this); }