Add more tests and fixes in Construction loaders.
[mono.git] / mcs / class / Microsoft.Build / Microsoft.Build.Construction / ProjectItemDefinitionGroupElement.cs
index eb8caa8991cc1fd1f0b72e46320fb749abe76042..1d74932b2ca8a6ad5d3a953581a48e2069eaf2a3 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-using System.Collections.Generic;
 using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml;
+using Microsoft.Build.Internal;
 
 namespace Microsoft.Build.Construction
 {
+        [System.Diagnostics.DebuggerDisplayAttribute ("#ItemDefinitions={Count} Condition={Condition} Label={Label}")]
         public class ProjectItemDefinitionGroupElement : ProjectElementContainer
         {
+                internal ProjectItemDefinitionGroupElement (ProjectRootElement containingProject)
+                {
+                        ContainingProject = containingProject;
+                }
                 public ICollection<ProjectItemDefinitionElement> ItemDefinitions {
-                        get {
-                                throw new NotImplementedException ();
-                        }
+                        get { return new CollectionFromEnumerable<ProjectItemDefinitionElement> (
+                                new FilteredEnumerable<ProjectItemDefinitionElement> (Children)); }
                 }
-
                 public ProjectItemDefinitionElement AddItemDefinition (string itemType)
                 {
-                        throw new NotImplementedException ();
+                        var definition = ContainingProject.CreateItemDefinitionElement (itemType);
+                        AppendChild (definition);
+                        return definition;
                 }
                 internal override string XmlName {
-                        get {
-                                throw new NotImplementedException ();
-                        }
+                        get { return "ItemDefinitionGroup"; }
+                }
+                internal override ProjectElement LoadChildElement (XmlReader reader)
+                {
+                        return AddItemDefinition (reader.LocalName);
                 }
         }
 }