Exemplo n.º 1
0
        public static TopicInfo GetTopicInfo(NotificationMessageHolderType msg, XmlElement rawMsg)
        {
            XmlNamespaceManager manager = EventsMainHelper.CreateNamespaceManager(rawMsg.OwnerDocument);

            XmlText text = null;

            if (msg.Topic.Any != null)
            {
                foreach (XmlNode any in msg.Topic.Any)
                {
                    var current = any as XmlText;
                    if (any != null)
                    {
                        text = current;
                        break;
                    }
                }
            }

            XmlNode topicNode = rawMsg.SelectSingleNode("b2:Topic", manager);

            string topic = text != null ? text.Value : "";

            return(TopicInfo.ExtractTopicInfoPACS(topic, topicNode));
        }
Exemplo n.º 2
0
 bool IsBeginMessage(Dictionary <NotificationMessageHolderType, XmlElement> NotificationMessages)
 {
     try
     {
         NotificationMessageHolderType Message = null;
         foreach (NotificationMessageHolderType l in NotificationMessages.Keys)
         {
             Message = l;
         }
         TopicInfo Topic = TopicInfo.ExtractTopicInfoPACS(Message.Topic.Any[0].InnerText, NotificationMessages[Message]);
         bool      match = TopicInfo.TopicsMatch(Topic, BeginTopic);
         return(match);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Exemplo n.º 3
0
        public static TopicInfo GetTopicInfo(NotificationMessageHolderType msg)
        {
            var rawMsg = msg.Topic.Any.First().OwnerDocument;
            XmlNamespaceManager manager = EventsMainHelper.CreateNamespaceManager(rawMsg);

            XmlText text = null;

            if (msg.Topic.Any != null)
            {
                foreach (XmlNode any in msg.Topic.Any)
                {
                    var current = any as XmlText;
                    if (any != null)
                    {
                        text = current;
                        break;
                    }
                }
            }

            string topic = text != null ? text.Value : "";

            return(TopicInfo.ExtractTopicInfoPACS(topic, msg.Topic));
        }
Exemplo n.º 4
0
        void VerifyBeginType(Dictionary <NotificationMessageHolderType, XmlElement> NotificationMessages)
        {
            bool match = false;
            NotificationMessageHolderType Message = null;

            try
            {
                foreach (NotificationMessageHolderType l in NotificationMessages.Keys)
                {
                    Message = l;
                }
                TopicInfo Topic = TopicInfo.ExtractTopicInfoPACS(Message.Topic.Any[0].InnerText, NotificationMessages[Message]);
                match = TopicInfo.TopicsMatch(Topic, BeginTopic);
            }
            catch (Exception)
            {
                Assert(false,
                       "Message topic undefind",
                       "Check if first message is " + BeginPath);
            }
            Assert(match,
                   "Message topic is wrong (topic or namespace)",
                   "Check if first message is " + BeginPath);
        }