private void Deserialize(string configXml)
 {
     if (!String.IsNullOrEmpty(configXml))
     {
         XmlDocument xmlDoc = new XmlDocument();
         xmlDoc.LoadXml(configXml);
         foreach (XmlElement xmlItem in xmlDoc.SelectNodes("/EventQueueConfig/PublishedEvents/Event"))
         {
             PublishedEvent oPublishedEvent = new PublishedEvent();
             oPublishedEvent.EventName = xmlItem.SelectSingleNode("EventName").InnerText;
             oPublishedEvent.Subscribers = xmlItem.SelectSingleNode("Subscribers").InnerText;
             this.PublishedEvents.Add(oPublishedEvent.EventName, oPublishedEvent);
         }
         foreach (XmlElement xmlItem in xmlDoc.SelectNodes("/EventQueueConfig/EventQueueSubscribers/Subscriber"))
         {
             SubscriberInfo oSubscriberInfo = new SubscriberInfo();
             oSubscriberInfo.ID = xmlItem.SelectSingleNode("ID").InnerText;
             oSubscriberInfo.Name = xmlItem.SelectSingleNode("Name").InnerText;
             oSubscriberInfo.Address = xmlItem.SelectSingleNode("Address").InnerText;
             oSubscriberInfo.Description = xmlItem.SelectSingleNode("Description").InnerText;
             oSubscriberInfo.PrivateKey = xmlItem.SelectSingleNode("PrivateKey").InnerText;
             this.EventQueueSubscribers.Add(oSubscriberInfo.ID, oSubscriberInfo);
         }
     }
 }
 public static void RegisterEventSubscription(EventQueueConfiguration config, string eventname, SubscriberInfo subscriber)
 {
     PublishedEvent e = new PublishedEvent();
     e.EventName = eventname;
     e.Subscribers = subscriber.ID;
     config.PublishedEvents.Add(e.EventName, e);
     if (!config.EventQueueSubscribers.ContainsKey(subscriber.ID))
     {
         config.EventQueueSubscribers.Add(subscriber.ID, subscriber);
     }
 }
        public static void RegisterEventSubscription(EventQueueConfiguration config, string eventname, SubscriberInfo subscriber)
        {
            PublishedEvent e = new PublishedEvent();

            e.EventName   = eventname;
            e.Subscribers = subscriber.ID;
            config.PublishedEvents.Add(e.EventName, e);
            if (!config.EventQueueSubscribers.ContainsKey(subscriber.ID))
            {
                config.EventQueueSubscribers.Add(subscriber.ID, subscriber);
            }
        }