partial void SendMessageButtonClicked(NSObject sender) { var messageText = MessageTextField.StringValue; if (messageText != string.Empty) { var message = new MacViewMessage(OrtcController.LocalPeer.Name, messageText); _messages.Add(message); var DataSource = new ChatTableDataSource(); _messages.ToList().ForEach(i => DataSource.Messages.Add(new MacViewMessage(i.Author, i.Text))); // Populate the Chat Table ChatTable.DataSource = DataSource; ChatTable.Delegate = new ChatTableDelegate(DataSource); OnSendMessageToRemotePeer(message); } MessageTextField.StringValue = String.Empty; }
private void OnSendMessageToRemotePeer(MacViewMessage message) { SendMessageToRemotePeer?.Invoke(this, message); }