Fix bug #2956: XmlReader.HasValue became virtual (from abstract) in .NET 4.
authorAtsushi Eno <atsushi@ximian.com>
Thu, 19 Jan 2012 09:52:36 +0000 (18:52 +0900)
committerAtsushi Eno <atsushi@ximian.com>
Thu, 19 Jan 2012 09:52:36 +0000 (18:52 +0900)
mcs/class/System.XML/System.Xml/XmlReader.cs

index e6fbe57ab2e44145d121125b48aafd321782aa46..f5434ec7cf396e1989a8a4124e24459f2e63a7f4 100644 (file)
@@ -123,7 +123,26 @@ namespace System.Xml
                        get { return AttributeCount > 0; }
                }
 
+#if NET_4_0
+               public virtual bool HasValue {
+                       get {
+                               switch (NodeType) {
+                               case XmlNodeType.Attribute:
+                               case XmlNodeType.Comment:
+                               case XmlNodeType.ProcessingInstruction:
+                               case XmlNodeType.SignificantWhitespace:
+                               case XmlNodeType.CDATA:
+                               case XmlNodeType.Text:
+                               case XmlNodeType.Whitespace:
+                               case XmlNodeType.XmlDeclaration:
+                                       return true;
+                               }
+                               return false;
+                       }
+               }
+#else
                public abstract bool HasValue { get; }
+#endif
 
                public abstract bool IsEmptyElement { get; }