public void SendMessage(Message m) { lock (_syncObj) { foreach (var callback in _clientsDict.Values) { callback.Receive(m); } } MainWindow.CurrentInstance.UpdateChatWindow(m.Content, m.Sender); }
public void ServerSendMessage(string message, string userName) { var m = new Message { Sender = "Server", Time = DateTime.Now, Content = message }; MainWindow.CurrentInstance.UpdateChatWindow(message, userName); lock (_syncObj) { foreach (var callback in _clientsDict.Values) { callback.Receive(m); } } }