Ejemplo n.º 1
0
 void SetProperty(MSBuildPropertyGroup propertyGroup, string name, bool value)
 {
     if (value)
     {
         propertyGroup.SetValue(name, value);
     }
     else
     {
         propertyGroup.RemoveProperty(name);
     }
 }
Ejemplo n.º 2
0
 void SetProperty(MSBuildPropertyGroup propertyGroup, string name, string value)
 {
     if (string.IsNullOrEmpty(value))
     {
         propertyGroup.RemoveProperty(name);
     }
     else
     {
         propertyGroup.SetValue(name, value);
     }
 }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
		}