コード例 #1
0
		/// <summary>
		/// Gets the attributes for the specified element. Also adds any standard
		/// attributes for the element which are not set.
		/// </summary>
		public WixXmlAttributeCollection GetAttributes(XmlElement element)
		{
			WixXmlAttributeCollection attributes = new WixXmlAttributeCollection();
			string elementName = element.Name;
			foreach (XmlAttribute attribute in element.Attributes) {
				string attributeName = attribute.Name;
				WixXmlAttributeType type = GetWixAttributeType(elementName, attributeName);
				WixDocument document = GetWixDocument(element);
				string[] attributeValues = GetAttributeValues(elementName, attributeName);
				WixXmlAttribute wixAttribute = new WixXmlAttribute(attributeName, attribute.Value, type, attributeValues, document);
				attributes.Add(wixAttribute);
			}
			attributes.AddRange(GetMissingAttributes(element, attributes, GetAttributeNames(elementName)));
			return attributes;
		}
コード例 #2
0
        /// <summary>
        /// Gets the attributes for the specified element. Also adds any standard
        /// attributes for the element which are not set.
        /// </summary>
        public WixXmlAttributeCollection GetAttributes(XmlElement element)
        {
            WixXmlAttributeCollection attributes = new WixXmlAttributeCollection();
            string elementName = element.Name;

            foreach (XmlAttribute attribute in element.Attributes)
            {
                string attributeName                = attribute.Name;
                WixXmlAttributeType type            = GetWixAttributeType(elementName, attributeName);
                WixDocument         document        = GetWixDocument(element);
                string[]            attributeValues = GetAttributeValues(elementName, attributeName);
                WixXmlAttribute     wixAttribute    = new WixXmlAttribute(attributeName, attribute.Value, type, attributeValues, document);
                attributes.Add(wixAttribute);
            }
            attributes.AddRange(GetMissingAttributes(element, attributes, GetAttributeNames(elementName)));
            return(attributes);
        }
コード例 #3
0
        /// <summary>
        /// Gets the attributes that have not been added to the
        /// <paramref name="attributes"/>.
        /// </summary>
        WixXmlAttributeCollection GetMissingAttributes(XmlElement element, WixXmlAttributeCollection existingAttributes, string[] attributes)
        {
            WixXmlAttributeCollection missingAttributes = new WixXmlAttributeCollection();

            foreach (string name in attributes)
            {
                if (existingAttributes[name] == null)
                {
                    string elementName                  = element.Name;
                    WixXmlAttributeType type            = GetWixAttributeType(elementName, name);
                    string[]            attributeValues = GetAttributeValues(elementName, name);
                    WixDocument         document        = GetWixDocument(element);
                    missingAttributes.Add(new WixXmlAttribute(name, type, attributeValues, document));
                }
            }
            return(missingAttributes);
        }
コード例 #4
0
		/// <summary>
		/// Gets the attributes that have not been added to the 
		/// <paramref name="attributes"/>.
		/// </summary>		
		WixXmlAttributeCollection GetMissingAttributes(XmlElement element, WixXmlAttributeCollection existingAttributes, string[] attributes)
		{
			WixXmlAttributeCollection missingAttributes = new WixXmlAttributeCollection();
			foreach (string name in attributes) {
				if (existingAttributes[name] == null) {
					string elementName = element.Name;
					WixXmlAttributeType type = GetWixAttributeType(elementName, name);
					string[] attributeValues = GetAttributeValues(elementName, name);
					WixDocument document = GetWixDocument(element);
					missingAttributes.Add(new WixXmlAttribute(name, type, attributeValues, document));
				}
			}
			return missingAttributes;
		}