private void PublishContextChangeHandler(object sender, DistributorEventArgs se) { try { lock (sync) { Console.WriteLine("TryPublish"); if (se.subcriber.ServiceCallback != null) { se.subcriber.ServiceCallback.ContextChanged(se.data); } } } catch (Exception ex) { Logger.Instance.ServiceDistributorDebug(ex); } }
private void InvokeSendEvent(IEnumerable <Subscriber> tempSub, StationContainer singleMonitor) { foreach (var item in tempSub) { DistributorEventArgs se = new DistributorEventArgs(); se.subcriber = item; if (se.subcriber != null) { foreach (var sub in _subscribers) { se.data = _catchersDictionary[sub.Key.DictionaryID]; if (singleMonitor.MonitorID == sub.Key.DictionaryID) { sub.Value.Invoke(this, se); } } } } }