|
|
|
@ -839,18 +839,50 @@ namespace ICSharpCode.SharpDevelop.Project
@@ -839,18 +839,50 @@ namespace ICSharpCode.SharpDevelop.Project
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
foreach (var propertyGroup in targetProject.PropertyGroups) { |
|
|
|
|
if (propertyGroup.Condition == groupCondition) { |
|
|
|
|
propertyGroup.AddProperty(propertyName, newValue); |
|
|
|
|
|
|
|
|
|
var matchedPropertyGroup = FindPropertyGroup(targetProject, groupCondition, position); |
|
|
|
|
if (matchedPropertyGroup != null) { |
|
|
|
|
matchedPropertyGroup.AddProperty(propertyName, newValue); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var newGroup = targetProject.AddPropertyGroup(); |
|
|
|
|
var newGroup = AddNewPropertyGroup(targetProject, position); |
|
|
|
|
newGroup.Condition = groupCondition; |
|
|
|
|
newGroup.AddProperty(propertyName, newValue); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ProjectPropertyGroupElement FindPropertyGroup(ProjectRootElement targetProject, string groupCondition, PropertyPosition position) |
|
|
|
|
{ |
|
|
|
|
ProjectPropertyGroupElement matchedPropertyGroup = null; |
|
|
|
|
foreach (var projectItem in targetProject.Children) { |
|
|
|
|
ProjectPropertyGroupElement propertyGroup = projectItem as ProjectPropertyGroupElement; |
|
|
|
|
if (propertyGroup != null) { |
|
|
|
|
if (propertyGroup.Condition == groupCondition) { |
|
|
|
|
matchedPropertyGroup = propertyGroup; |
|
|
|
|
if (position != PropertyPosition.UseExistingOrCreateAfterLastImport) { |
|
|
|
|
return matchedPropertyGroup; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (position == PropertyPosition.UseExistingOrCreateAfterLastImport) { |
|
|
|
|
if (projectItem is ProjectImportElement) { |
|
|
|
|
matchedPropertyGroup = null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return matchedPropertyGroup; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ProjectPropertyGroupElement AddNewPropertyGroup(ProjectRootElement targetProject, PropertyPosition position) |
|
|
|
|
{ |
|
|
|
|
if (position == PropertyPosition.UseExistingOrCreateAfterLastImport) { |
|
|
|
|
var propertyGroup = targetProject.CreatePropertyGroupElement(); |
|
|
|
|
targetProject.AppendChild(propertyGroup); |
|
|
|
|
return propertyGroup; |
|
|
|
|
} |
|
|
|
|
return targetProject.AddPropertyGroup(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Removes the property from all configurations and platforms.
|
|
|
|
|
/// </summary>
|
|
|
|
|