예제 #1
0
        /// <summary>
        /// Removes properties defined by this extension.
        /// </summary>
        /// <param name="tables">The collection of tables.</param>
        private void FinalizeProperties()
        {
            string[] properties = new string[] { "DISABLEDEPENDENCYCHECK", "IGNOREDEPENDENCIES" };
            foreach (string property in properties)
            {
                Wix.Property elem = this.Core.GetIndexedElement("Property", property) as Wix.Property;
                if (null != elem)
                {
                    // If a value is defined, log a warning we're removing it.
                    if (!String.IsNullOrEmpty(elem.Value))
                    {
                        this.Core.OnMessage(DependencyWarnings.PropertyRemoved(elem.Id));
                    }

                    // If the property row was found, remove it from its parent.
                    if (null != elem.ParentElement)
                    {
                        Wix.IParentElement elemParent = elem.ParentElement as Wix.IParentElement;
                        if (null != elemParent)
                        {
                            elemParent.RemoveChild(elem);
                        }
                    }
                }
            }
        }
예제 #2
0
 /// <summary>
 /// Adds a Property to the main Fragment.
 /// </summary>
 /// <param name="propertyId">Id of the Property.</param>
 /// <param name="value">Value of the Property.</param>
 private void AddProperty(string propertyId, string value)
 {
     Wix.Property property = new Wix.Property();
     property.Id    = propertyId;
     property.Value = value;
     this.fragment.AddChild(property);
 }