private void OnMessageRecived(Object source, ReceiveCompletedEventArgs e) { MessageQueue mq = null; System.Messaging.Message m = null; try { //incercam sa luam mesajul primit mq = (MessageQueue)source; m = mq.EndReceive(e.AsyncResult); } catch { MessageBox.Show("Error"); } m.Formatter = new BinaryMessageFormatter(); EditorMessages msg = (EditorMessages)m.Body; switch (msg.Type) { case MSG_TYPE.NEW_TEXT: SetText(msg.Text); break; } try { mq.BeginReceive(); } catch { MessageBox.Show("Error"); } }
public EditorMessagesBuilder(EditorMessages messages) { this.messages = messages; }