Ejemplo n.º 1
0
        private void AddPropertyToPropertyGroup(ProjectPropertyElement property, ProjectPropertyGroupElement destinationPropertyGroup)
        {
            var outputProperty = destinationPropertyGroup.ContainingProject.CreatePropertyElement("___TEMP___");

            outputProperty.CopyFrom(property);

            destinationPropertyGroup.AppendChild(outputProperty);
        }
        void AddPropertyWithCondition(ProjectRootElement projectRoot, string name, string value, string condition)
        {
            ProjectPropertyGroupElement groupProperty = projectRoot.CreatePropertyGroupElement();

            groupProperty.Condition = condition;
            projectRoot.AppendChild(groupProperty);

            ProjectPropertyElement property = projectRoot.CreatePropertyElement(name);

            groupProperty.AppendChild(property);
            property.Value     = value;
            property.Condition = condition;
        }
        public void Save(string filePath)
        {
            if (_versionsPropGroup == null)
            {
                _versionsPropGroup       = _document.AddPropertyGroup();
                _versionsPropGroup.Label = PackageVersionsLabel;
            }

            _versionsPropGroup.RemoveAllChildren();
            foreach (var item in _versionElements.Values)
            {
                _versionsPropGroup.AppendChild(item);
            }

            _document.Save(filePath, Encoding.UTF8);
        }