/// <summary> /// Publish a message /// </summary> /// <param name="message">Message to publish</param> /// <returns>Flag indicating if the messaged was handled by at least 1 subscriber</returns> public bool Publish(UdpMessage message) { var handled = false; lock (_lock) { _subscriptions.OrderByDescending(s => s.Priority).ToList().ForEach(es => { if (es != null && es.Handler != null && es.Predicate != null) { if (es.Predicate.Invoke(message)) { if (InvokeActionWrapper != null) { InvokeActionWrapper.Invoke(() => es.Handler.Invoke(message)); } else { es.Handler.Invoke(message); } handled = true; } } }); } return(handled); }
public RtsConference() { InitializeComponent(); _actionWrapper = new InvokeActionWrapper(this); _outputTools = new Tools.OutputInfoText(richTextBox1); NIM.RtsAPI.SetReceiveDataCallback(OnReceiveData); }
public TeamList(ListView list) { _teamListView = list; _teamListView.MouseUp += _teamListView_MouseUp; _teamListView.DoubleClick += _teamListView_DoubleClick; NIM.Team.TeamAPI.TeamEventNotificationHandler += OnTeamEventNotify; _actionWrapper = new InvokeActionWrapper(list); list.View = View.Details; }
public OutputInfoText(RichTextBox box) { _richTextbox = box; _actionWrapper = new InvokeActionWrapper(box); }
public HttpForm() { InitializeComponent(); SetDataBindings(); _invokeWrapper = new InvokeActionWrapper(this); }