X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.XML%2FSystem.Xml%2FXmlAttributeCollection.cs;h=d1d63a20f9db73a030537532a3193aecf0a35e61;hb=c90d6dba5b846570d0697e76af77338652af469d;hp=203d8d33f155a323a3128be24c00dc9740a70b67;hpb=c004fb18995530e4b6d221e0024fc78724b5063b;p=mono.git diff --git a/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs b/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs index 203d8d33f15..d1d63a20f9d 100644 --- a/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs +++ b/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs @@ -3,28 +3,39 @@ // // Author: // Jason Diamond (jason@injektilo.org) +// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp) // // (C) 2002 Jason Diamond http://injektilo.org/ +// (C) 2002 Atsushi Enomoto // using System; using System.Collections; +using Mono.Xml; namespace System.Xml { public class XmlAttributeCollection : XmlNamedNodeMap, ICollection { + XmlElement ownerElement; + XmlDocument ownerDocument; + internal XmlAttributeCollection (XmlNode parent) : base (parent) { + ownerElement = parent as XmlElement; + ownerDocument = parent.OwnerDocument; + if(ownerElement == null) + throw new XmlException ("invalid construction for XmlAttributeCollection."); } bool ICollection.IsSynchronized { - get { - throw new NotImplementedException (); - } + get { return false; } + } + + bool IsReadOnly { + get { return ownerElement.IsReadOnly; } } - [MonoTODO] [System.Runtime.CompilerServices.IndexerName ("ItemOf")] public virtual XmlAttribute this [string name] { get { @@ -32,7 +43,6 @@ namespace System.Xml } } - [MonoTODO] [System.Runtime.CompilerServices.IndexerName ("ItemOf")] public virtual XmlAttribute this [int i] { get { @@ -40,78 +50,241 @@ namespace System.Xml } } - [MonoTODO] [System.Runtime.CompilerServices.IndexerName ("ItemOf")] public virtual XmlAttribute this [string localName, string namespaceURI] { get { - throw new NotImplementedException (); + return (XmlAttribute) GetNamedItem (localName, namespaceURI); } } object ICollection.SyncRoot { - get { - throw new NotImplementedException (); - } + get { return this; } } - [MonoTODO] + public virtual XmlAttribute Append (XmlAttribute node) { - throw new NotImplementedException (); - } + XmlNode xmlNode = this.SetNamedItem (node); + return node; + } - [MonoTODO] - public void CopyTo (XmlAttribute [] array, int index) + public void CopyTo (XmlAttribute[] array, int index) { - throw new NotImplementedException (); + // assuming that Nodes is a correct collection. + for(int i=0; i