コード例 #1
0
        void ValidateAccessPointTopic(XmlElement messageDescription,
                                      TopicInfo topicInfo,
                                      MessageDescription messageInfo)
        {
            // checks MessageDescription and IsProperty
            ValidateTopic(messageDescription, topicInfo, messageInfo.IsProperty);

            {
                bool          ok     = true;
                StringBuilder logger = new StringBuilder();

                // check MessageDescription
                bool localOk = ValidateAccessPointEventTopicSource(messageDescription, topicInfo, logger);
                ok = ok && localOk;

                if (messageInfo.DataSimpleItems.Count > 0)
                {
                    XmlElement dataElement = messageDescription.GetMessageData();
                    if (dataElement == null)
                    {
                        ok = false;
                        logger.AppendLine("Message Data element is missing");
                    }
                    else
                    {
                        string err;
                        bool   success;

                        Dictionary <string, XmlElement> dataSimpleItems = messageDescription.GetMessageDataSimpleItemDescriptions(out success, out err);

                        if (success)
                        {
                            foreach (string itemName in messageInfo.DataSimpleItems.Keys)
                            {
                                SimpleItemDescription itemType = messageInfo.DataSimpleItems[itemName];
                                localOk = ValidateSimpleItemDescription(dataSimpleItems, "Data",
                                                                        itemName, itemType.Type, itemType.Namespace, logger);
                                ok = ok && localOk;
                            }
                        }
                        else
                        {
                            ok = false;
                            logger.AppendLine("Data element is incorrect: " + err);
                        }
                    }
                }
                Assert(ok, logger.ToStringTrimNewLine(), "Check that Topic is correct");
            }
        }
コード例 #2
0
        public void AddSimpleItem(string name, string type, string ns, bool mandatory)
        {
            SimpleItemDescription item = new SimpleItemDescription(name, type, ns, mandatory);

            _dataSimpleItems.Add(name, item);
        }