From a890db1917a26608fb7779d64d556ac46bc73813 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Thu, 19 Jan 2012 18:52:36 +0900 Subject: [PATCH] Fix bug #2956: XmlReader.HasValue became virtual (from abstract) in .NET 4. --- mcs/class/System.XML/System.Xml/XmlReader.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mcs/class/System.XML/System.Xml/XmlReader.cs b/mcs/class/System.XML/System.Xml/XmlReader.cs index e6fbe57ab2e..f5434ec7cf3 100644 --- a/mcs/class/System.XML/System.Xml/XmlReader.cs +++ b/mcs/class/System.XML/System.Xml/XmlReader.cs @@ -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; } -- 2.11.4.GIT