Merge pull request #4540 from kumpera/android-changes-part1
[mono.git] / mcs / class / Microsoft.Build / Microsoft.Build.Construction / ProjectWhenElement.cs
index 8f27b2af570c38ce5767a1848a76228665af22a8..0d7331afcbfdee8b32467ad2e67957295e461b7c 100644 (file)
@@ -29,6 +29,8 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Xml;
+using Microsoft.Build.Exceptions;
 using Microsoft.Build.Internal;
 
 namespace Microsoft.Build.Construction
@@ -56,9 +58,9 @@ namespace Microsoft.Build.Construction
                 internal override string XmlName {
                         get { return "When"; }
                 }
-                internal override ProjectElement LoadChildElement (string name)
+                internal override ProjectElement LoadChildElement (XmlReader reader)
                 {
-                        switch (name) {
+                        switch (reader.LocalName) {
                         case "PropertyGroup":
                                 var property = ContainingProject.CreatePropertyGroupElement ();
                                 AppendChild (property);
@@ -72,8 +74,8 @@ namespace Microsoft.Build.Construction
                                 AppendChild (when);
                                 return when;
                         default:
-                                throw new NotImplementedException (string.Format (
-                                        "Child \"{0}\" is not a known node type.", name));
+                                throw new InvalidProjectFileException (string.Format (
+                                        "Child \"{0}\" is not a known node type.", reader.LocalName));
                         }
                 }
         }