internal ProjectPropertyElement LookupProperty(ProjectPropertyGroupElement parent, string name, string condition = null)
{
ProjectPropertyElement property = null;
var label = Pivots.GetExpressionLabel(condition);
name = name.Replace(".", "_");
if(string.IsNullOrEmpty(condition)) {
property = parent.Properties.FirstOrDefault(each => name == each.Name && string.IsNullOrEmpty(each.Condition));
if(property != null) {
return property;
}
return parent.AddProperty(name, "");
}
var conditionExpression = Pivots.GetMSBuildCondition(Name, condition);
property = parent.Properties.FirstOrDefault(each => name == each.Name && each.Condition == conditionExpression);
if(property != null) {
return property;
}
property = parent.AddProperty(name, "");
property.Label = label;
property.Condition = conditionExpression;
return property;
}