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