#if NET_2_0
using System;
-using System.Collections;
+using System.Collections.Generic;
using System.Xml;
using System.Xml.Schema;
get { return initial ? 0 : Reader.AttributeCount; }
}
-#if NET_2_0
public override bool CanReadBinaryContent {
get { return Reader.CanReadBinaryContent; }
}
public override bool CanReadValueChunk {
get { return Reader.CanReadValueChunk; }
}
-#endif
public override int Depth {
get { return Reader.Depth - startDepth; }
get { return eof || Reader.EOF; }
}
+ public override bool IsEmptyElement {
+ get { return Reader.IsEmptyElement; }
+ }
+
public int LineNumber {
get { return initial ? 0 : li != null ? li.LineNumber : 0; }
}
}
public override bool HasValue {
- get { return initial ? false : Reader.HasValue; }
+ get { return initial || eof ? false : Reader.HasValue; }
}
public override string LocalName {
- get { return initial ? String.Empty : Reader.LocalName; }
+ get { return initial || eof ? String.Empty : Reader.LocalName; }
}
public override string Name {
- get { return initial ? String.Empty : Reader.Name; }
+ get { return initial || eof ? String.Empty : Reader.Name; }
}
public override XmlNameTable NameTable {
}
public override string NamespaceURI {
- get { return initial ? String.Empty : Reader.NamespaceURI; }
+ get { return initial || eof ? String.Empty : Reader.NamespaceURI; }
}
public override XmlNodeType NodeType {
- get { return initial ? XmlNodeType.None : Reader.NodeType; }
+ get { return initial || eof ? XmlNodeType.None : Reader.NodeType; }
}
public override string Prefix {
- get { return initial ? String.Empty : Reader.Prefix; }
+ get { return initial || eof ? String.Empty : Reader.Prefix; }
}
public override ReadState ReadState {
get { return initial ? ReadState.Initial : eof ? ReadState.EndOfFile : Reader.ReadState ; }
}
+#if !NET_2_1
public override IXmlSchemaInfo SchemaInfo {
get { return Reader.SchemaInfo; }
}
+#endif
public override XmlReaderSettings Settings {
get { return Reader.Settings; }
public override void Close ()
{
- // do nothing
+ while (Read ())
+ ;
}
public override string GetAttribute (int i)
return initial ? null : Reader.GetAttribute (local, ns);
}
- IDictionary IXmlNamespaceResolver.GetNamespacesInScope (XmlNamespaceScope scope)
+ IDictionary<string, string> IXmlNamespaceResolver.GetNamespacesInScope (XmlNamespaceScope scope)
{
- return nsResolver != null ? nsResolver.GetNamespacesInScope (scope) : new Hashtable ();
+ return nsResolver != null ? nsResolver.GetNamespacesInScope (scope) :
+ new Dictionary<string, string> ();
}
public bool HasLineInfo ()
}
if (!read) {
read = true;
- return !Reader.IsEmptyElement && Reader.Read ();
+ Reader.MoveToElement ();
+ bool ret = !Reader.IsEmptyElement && Reader.Read ();
+ if (!ret)
+ eof = true;
+ return ret;
}
+ Reader.MoveToElement ();
if (Reader.Depth > startDepth)
if (Reader.Read ())
return true;