public MSBuildItemGroup AddNewItemGroup() { AssertCanModify(); var group = new MSBuildItemGroup(); MSBuildObject refNode = null; var lastGroup = ItemGroups.LastOrDefault(); if (lastGroup != null) { refNode = lastGroup; } else { var g = PropertyGroups.LastOrDefault(); if (g != null) { refNode = g; } } group.ParentNode = this; if (refNode != null) { ChildNodes = ChildNodes.Insert(ChildNodes.IndexOf(refNode) + 1, group); } else { ChildNodes = ChildNodes.Add(group); } group.ResetIndent(true); NotifyChanged(); return(group); }
public void AddItemGroup(ItemGroup itemGroup) { var lastNode = (CsProjectNode)ItemGroups.LastOrDefault() ?? PropertyGroups.Last(); lastNode.AddAfterSelf(itemGroup); }