Example #1
0
        private void AddChoiceElement(XmlNode aChoiceNode, ItemMetadataDefinitionAttribute aItemMetadataAttribute)
        {
            XmlNode lElement = aChoiceNode.OwnerDocument.CreateNode("element", "xs:element", "");

            aChoiceNode.AppendChild(lElement);
            AddAttribute(lElement, "name", aItemMetadataAttribute.MetadataName);
            AddAnnotationNode(lElement, aItemMetadataAttribute.Description);
        }
Example #2
0
        public void GetMSBuildProperties(object[] aAssemblyAttributes, PropertyDefinitionList aPropertyList, ItemDefinitionList aItemList)
        {
            if (aPropertyList == null)
            {
                throw new ArgumentNullException("PropertyList parameter is null");
            }
            if (aItemList == null)
            {
                throw new ArgumentNullException("ItemList parameter is null");
            }
            if (aAssemblyAttributes == null)
            {
                return;
            }
            Dictionary <string, ItemDefinitionContainer> lItemContainerDictionary = new Dictionary <string, ItemDefinitionContainer>();
            List <ItemMetadataDefinitionAttribute>       lItemMetadataList        = new List <ItemMetadataDefinitionAttribute>();

            foreach (object lObj in aAssemblyAttributes)
            {
                PropertyDefinitionAttribute     lProperty     = lObj as PropertyDefinitionAttribute;
                ItemDefinitionAttribute         lItem         = lObj as ItemDefinitionAttribute;
                ItemMetadataDefinitionAttribute lItemMetadata = lObj as ItemMetadataDefinitionAttribute;
                if (lProperty != null)
                {
                    aPropertyList.Add(lProperty);
                }
                if (lItem != null)
                {
                    ItemDefinitionContainer lContainer = new ItemDefinitionContainer(lItem);
                    aItemList.Add(lContainer);
                    lItemContainerDictionary.Add(lItem.PropertyName, lContainer);
                }
                if (lItemMetadata != null)
                {
                    lItemMetadataList.Add(lItemMetadata);
                }
            }
            // now add all the meta data with the ItemGroup
            foreach (ItemMetadataDefinitionAttribute lItemMetadata in lItemMetadataList)
            {
                if (lItemContainerDictionary.ContainsKey(lItemMetadata.PropertyName))
                {
                    lItemContainerDictionary[lItemMetadata.PropertyName].ItemMetadataDefinitionList.Add(lItemMetadata);
                }
            }
        }