Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        public void AddItemGroup(ItemGroup itemGroup)
        {
            var lastNode = (CsProjectNode)ItemGroups.LastOrDefault() ?? PropertyGroups.Last();

            lastNode.AddAfterSelf(itemGroup);
        }