VsTeXProject.VisualStudio.Project.ProjectNode.ClonePropertyGroup C# (CSharp) Метод

ClonePropertyGroup() приватный Метод

For internal use only. This creates a copy of an existing configuration and add it to the project. Caller should change the condition on the PropertyGroup. If derived class want to accomplish this, they should call ConfigProvider.AddCfgsOfCfgName() It is expected that in the future MSBuild will have support for this so we don't have to do it manually.
private ClonePropertyGroup ( Microsoft.Build.Construction group ) : Microsoft.Build.Construction.ProjectPropertyGroupElement
group Microsoft.Build.Construction PropertyGroup to clone
Результат Microsoft.Build.Construction.ProjectPropertyGroupElement
        internal MSBuildConstruction.ProjectPropertyGroupElement ClonePropertyGroup(
            MSBuildConstruction.ProjectPropertyGroupElement group)
        {
            // Create a new (empty) PropertyGroup
            var newPropertyGroup = buildProject.Xml.AddPropertyGroup();

            // Now copy everything from the group we are trying to clone to the group we are creating
            if (!string.IsNullOrEmpty(group.Condition))
                newPropertyGroup.Condition = group.Condition;
            foreach (var prop in group.Properties)
            {
                var newProperty = newPropertyGroup.AddProperty(prop.Name, prop.Value);
                if (!string.IsNullOrEmpty(prop.Condition))
                    newProperty.Condition = prop.Condition;
            }

            return newPropertyGroup;
        }
ProjectNode