internal ProjectPropertyGroupElement LookupPropertyGroup(string condition)
{
// look it up or create it.
var label = Pivots.GetExpressionLabel(condition);
ProjectPropertyGroupElement propertyGroup;
if(string.IsNullOrEmpty(condition)) {
propertyGroup = Xml.PropertyGroups.FirstOrDefault(each => string.IsNullOrEmpty(each.Label));
if(propertyGroup != null) {
return propertyGroup;
}
}
else {
propertyGroup = Xml.PropertyGroups.FirstOrDefault(each => label == each.Label);
if(propertyGroup != null) {
return propertyGroup;
}
}
propertyGroup = Xml.AddPropertyGroup();
if(!string.IsNullOrEmpty(condition)) {
propertyGroup.Label = label;
propertyGroup.Condition = Pivots.GetMSBuildCondition(Name, condition);
}
return propertyGroup;
}