static void RemoveOutputTypeIfHasDefaultValue(MSBuildProject project, MSBuildPropertyGroup globalPropertyGroup) { string outputType = project.EvaluatedProperties.GetValue("OutputType"); if (string.IsNullOrEmpty(outputType)) { globalPropertyGroup.RemoveProperty("OutputType"); } else { RemovePropertyIfHasDefaultValue(globalPropertyGroup, "OutputType", outputType); } }
static void RemovePropertyIfHasDefaultValue( MSBuildPropertyGroup propertyGroup, string propertyName, string defaultPropertyValue) { if (!propertyGroup.HasProperty(propertyName)) { return; } if (propertyGroup.GetValue(propertyName) == defaultPropertyValue) { propertyGroup.RemoveProperty(propertyName); } }
bool IPropertySet.RemoveProperty(string name) { AssertLinkedToGroup(); return(LinkedGroup.RemoveProperty(name)); }