Make a copy of the old ZipLib
[mono.git] / mcs / class / System.XML / System.Xml.XPath / XPathNodeIterator.cs
index d27f65a0f12d4b2499a88d05724642a3ec687ec2..cec0f03971123d63071aa58d639cde265203559e 100644 (file)
@@ -7,11 +7,41 @@
 // (C) 2002 Jason Diamond  http://injektilo.org/
 //
 
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
 using System;
+using System.Collections;
+#if NET_2_0
+using System.Diagnostics;
+#endif
 
 namespace System.Xml.XPath
 {
+#if NET_2_0
+       [DebuggerDisplay ("Position={CurrentPosition}, Current={Current == null ? null : (object) new XPathNavigator.DebuggerDisplayProxy(Current)}")]
+       public abstract class XPathNodeIterator : ICloneable, IEnumerable
+#else
        public abstract class XPathNodeIterator : ICloneable
+#endif
        {
                private int _count = -1;
 
@@ -56,6 +86,14 @@ namespace System.Xml.XPath
                        return Clone ();
                }
 
+#if NET_2_0
+               public virtual IEnumerator GetEnumerator ()
+               {
+                       while (MoveNext ())
+                               yield return Current;
+               }
+#endif
+
                public abstract bool MoveNext ();
                
                #endregion