Example #1
0
        /// <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);
        }
Example #2
0
 public RtsConference()
 {
     InitializeComponent();
     _actionWrapper = new InvokeActionWrapper(this);
     _outputTools   = new Tools.OutputInfoText(richTextBox1);
     NIM.RtsAPI.SetReceiveDataCallback(OnReceiveData);
 }
Example #3
0
 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;
 }
Example #4
0
 public OutputInfoText(RichTextBox box)
 {
     _richTextbox   = box;
     _actionWrapper = new InvokeActionWrapper(box);
 }
Example #5
0
 public HttpForm()
 {
     InitializeComponent();
     SetDataBindings();
     _invokeWrapper = new InvokeActionWrapper(this);
 }