Beispiel #1
0
		internal override void Evaluate (MSBuildEvaluationContext context)
		{
			if (!string.IsNullOrEmpty (Condition)) {
				string cond;
				if (!context.Evaluate (Condition, out cond)) {
					// The condition could not be evaluated. Clear all properties that this group defines
					// since we don't know if they will have a value or not
					foreach (var prop in Properties)
						context.ClearPropertyValue (prop.Name);
					return;
				}
				if (!ConditionParser.ParseAndEvaluate (cond, context))
					return;
			}

			foreach (var prop in propertyList)
				prop.Evaluate (context);
		}
Beispiel #2
0
		internal override void Evaluate (MSBuildEvaluationContext context)
		{
			EvaluatedElement = null;

			if (!string.IsNullOrEmpty (Condition)) {
				string cond;
				if (!context.Evaluate (Condition, out cond)) {
					// The value could not be evaluated, so if there is an existing value, it is not valid anymore
					context.ClearPropertyValue (Name);
					return;
				}
				if (!ConditionParser.ParseAndEvaluate (cond, context))
					return;
			}

			XmlElement elem;

			if (context.Evaluate (Element, out elem)) {
				EvaluatedElement = elem;
				context.SetPropertyValue (Name, GetValue ());
			} else {
				// The value could not be evaluated, so if there is an existing value, it is not valid anymore
				context.ClearPropertyValue (Name);
			}
		}