|
|
@@ -36,7 +36,11 @@ using Mono.Xml;
|
|
|
|
|
|
namespace System.Xml
|
|
|
{
|
|
|
+#if NET_2_0
|
|
|
+ public sealed class XmlAttributeCollection : XmlNamedNodeMap, ICollection
|
|
|
+#else
|
|
|
public class XmlAttributeCollection : XmlNamedNodeMap, ICollection
|
|
|
+#endif
|
|
|
{
|
|
|
XmlElement ownerElement;
|
|
|
XmlDocument ownerDocument;
|
|
|
@@ -58,21 +62,33 @@ namespace System.Xml
|
|
|
}
|
|
|
|
|
|
[System.Runtime.CompilerServices.IndexerName ("ItemOf")]
|
|
|
+#if NET_2_0
|
|
|
+ public XmlAttribute this [string name] {
|
|
|
+#else
|
|
|
public virtual XmlAttribute this [string name] {
|
|
|
+#endif
|
|
|
get {
|
|
|
return (XmlAttribute) GetNamedItem (name);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
[System.Runtime.CompilerServices.IndexerName ("ItemOf")]
|
|
|
+#if NET_2_0
|
|
|
+ public XmlAttribute this [int i] {
|
|
|
+#else
|
|
|
public virtual XmlAttribute this [int i] {
|
|
|
+#endif
|
|
|
get {
|
|
|
return (XmlAttribute) Nodes [i];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
[System.Runtime.CompilerServices.IndexerName ("ItemOf")]
|
|
|
+#if NET_2_0
|
|
|
+ public XmlAttribute this [string localName, string namespaceURI] {
|
|
|
+#else
|
|
|
public virtual XmlAttribute this [string localName, string namespaceURI] {
|
|
|
+#endif
|
|
|
get {
|
|
|
return (XmlAttribute) GetNamedItem (localName, namespaceURI);
|
|
|
}
|
|
|
@@ -82,8 +98,11 @@ namespace System.Xml
|
|
|
get { return this; }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+#if NET_2_0
|
|
|
+ public XmlAttribute Append (XmlAttribute node)
|
|
|
+#else
|
|
|
public virtual XmlAttribute Append (XmlAttribute node)
|
|
|
+#endif
|
|
|
{
|
|
|
XmlNode xmlNode = this.SetNamedItem (node);
|
|
|
return node;
|
|
|
@@ -102,7 +121,11 @@ namespace System.Xml
|
|
|
array.CopyTo (Nodes.ToArray (typeof(XmlAttribute)), index);
|
|
|
}
|
|
|
|
|
|
+#if NET_2_0
|
|
|
+ public XmlAttribute InsertAfter (XmlAttribute newNode, XmlAttribute refNode)
|
|
|
+#else
|
|
|
public virtual XmlAttribute InsertAfter (XmlAttribute newNode, XmlAttribute refNode)
|
|
|
+#endif
|
|
|
{
|
|
|
if (refNode == null) {
|
|
|
if (Nodes.Count == 0)
|
|
|
@@ -117,7 +140,11 @@ namespace System.Xml
|
|
|
throw new ArgumentException ("refNode not found in this collection.");
|
|
|
}
|
|
|
|
|
|
+#if NET_2_0
|
|
|
+ public XmlAttribute InsertBefore (XmlAttribute newNode, XmlAttribute refNode)
|
|
|
+#else
|
|
|
public virtual XmlAttribute InsertBefore (XmlAttribute newNode, XmlAttribute refNode)
|
|
|
+#endif
|
|
|
{
|
|
|
if (newNode.OwnerDocument != ownerDocument)
|
|
|
throw new ArgumentException ("different document created this newNode.");
|
|
|
@@ -143,12 +170,20 @@ namespace System.Xml
|
|
|
return newNode;
|
|
|
}
|
|
|
|
|
|
+#if NET_2_0
|
|
|
+ public XmlAttribute Prepend (XmlAttribute node)
|
|
|
+#else
|
|
|
public virtual XmlAttribute Prepend (XmlAttribute node)
|
|
|
+#endif
|
|
|
{
|
|
|
return this.InsertAfter (node, null);
|
|
|
}
|
|
|
|
|
|
+#if NET_2_0
|
|
|
+ public XmlAttribute Remove (XmlAttribute node)
|
|
|
+#else
|
|
|
public virtual XmlAttribute Remove (XmlAttribute node)
|
|
|
+#endif
|
|
|
{
|
|
|
if (IsReadOnly)
|
|
|
throw new ArgumentException ("This attribute collection is read-only.");
|
|
|
@@ -187,7 +222,11 @@ namespace System.Xml
|
|
|
return retAttr;
|
|
|
}
|
|
|
|
|
|
+#if NET_2_0
|
|
|
+ public void RemoveAll ()
|
|
|
+#else
|
|
|
public virtual void RemoveAll ()
|
|
|
+#endif
|
|
|
{
|
|
|
int current = 0;
|
|
|
while (current < Count) {
|
|
|
@@ -199,7 +238,11 @@ namespace System.Xml
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+#if NET_2_0
|
|
|
+ public XmlAttribute RemoveAt (int i)
|
|
|
+#else
|
|
|
public virtual XmlAttribute RemoveAt (int i)
|
|
|
+#endif
|
|
|
{
|
|
|
if(Nodes.Count <= i)
|
|
|
return null;
|