Esempio n. 1
0
 public void Publish(Message e, String topicName)
 {
     if (e != null)
     {
         Console.WriteLine("Event received");
         Console.WriteLine("topic name {0} event data {1}",e.TopicName, e.EventData);
     }
 }
Esempio n. 2
0
        public void Publish(Message e, string topicName)
        {
            List<IPublish> subscribers = Filter.GetSubscribers(topicName);

            if (subscribers == null)
                return;

            Type type = typeof(IPublish);

            MethodInfo publishMethodInfo = type.GetMethod("Publish");

            foreach (IPublish subcriber in subscribers)
            {
                try
                {
                    publishMethodInfo.Invoke(subcriber, new object[] { e, topicName });
                }
                catch(Exception ex)
                {
                    CrFSMLogger.CrFSMLogger.Instance.WriteToLog(ex);
                }
            }
        }