Exemplo n.º 1
0
        public void LinkToProperty(MSBuildProperty property)
        {
            // Binds this evaluated property to a property defined in a property group, so that if this evaluated property
            // is modified, the change will be propagated to that linked property.
            linkedProperty = property;

            if (EvaluatedValueIsStale && property != null)
            {
                // This will be true if the property has been modified in the project,
                // which means that the evaluated value of the property may be out of date.
                // In that case, we set the EvaluatedValueModified on the linked property,
                // which means that the property will be saved no matter what the
                // evaluated value was. Also, InitEvaluatedValue() is not called
                // because the evaluated value we have is stale

                property.EvaluatedValueModified = true;
                return;
            }

            // Initialize the linked property with the evaluated property only if it has not yet modified (it doesn't have
            // its own value).
            if (linkedProperty != null && !linkedProperty.Modified && !IsNew)
            {
                linkedProperty.InitEvaluatedValue(evaluatedValue, DefinedMultipleTimes || property.IsNew);
            }

            // DefinedMultipleTimes is used to determine if the property value has been set several times during evaluation.
            // This is useful to know because if the property is set only once, we know that if we remove the property definition,
            // we are resetting the property to an empty value, and not just inheriting a value from a previous definition.
            // This information is provided to the linked property in the InitEvaluatedValue call, and used later on
            // when saving the project to determine if the property definition can be removed or not.
            // If property.IsNew==true it means that the property was not defined in the property group, and it is now
            // being defined. It means that the property will actually end having multiple definitions (the definition
            // that generated this evaluated property, and the new one in the property group).
        }
Exemplo n.º 2
0
 public void LinkToProperty(MSBuildProperty property)
 {
     linkedProperty = property;
     if (linkedProperty != null && !linkedProperty.Modified && !IsNew)
     {
         linkedProperty.InitEvaluatedValue(evaluatedValue);
     }
 }
		public void LinkToProperty (MSBuildProperty property)
		{
			linkedProperty = property;
			if (linkedProperty != null && !linkedProperty.Modified && !IsNew)
				linkedProperty.InitEvaluatedValue (evaluatedValue);
		}