}
bool ICollection.IsSynchronized {
- get {
- throw new NotImplementedException ();
- }
+ get { return false; }
}
bool IsReadOnly {
- get {
- return ownerElement.IsReadOnly;
- }
+ get { return ownerElement.IsReadOnly; }
}
[System.Runtime.CompilerServices.IndexerName ("ItemOf")]
}
object ICollection.SyncRoot {
- get {
- throw new NotImplementedException ();
- }
+ get { return this; }
}
RemoveIdenticalAttribute (retAttr);
ownerDocument.onNodeRemoved (node, null);
}
+ // If it is default, then directly create new attribute.
+ if (!retAttr.Specified) {
+ XmlAttribute attr = ownerDocument.CreateAttribute (retAttr.Prefix,
+ retAttr.LocalName, retAttr.NamespaceURI);
+ attr.SetDefault ();
+ foreach (XmlNode child in retAttr.ChildNodes)
+ attr.AppendChild (child);
+ this.SetNamedItem (attr);
+ }
return retAttr;
}
public virtual void RemoveAll ()
{
- while(Count > 0)
- Remove ((XmlAttribute)Nodes [0]);
+ int current = 0;
+ while (current < Count) {
+ XmlAttribute attr = this [current];
+ if (!attr.Specified)
+ current++;
+ // It is called for the purpose of event support.
+ Remove (attr);
+ }
}
public virtual XmlAttribute RemoveAt (int i)
XmlDocumentType doctype = node.OwnerDocument.DocumentType;
if (doctype == null || doctype.DTD == null)
return existing;
- DTDElementDeclaration elem = doctype.DTD.ElementDecls [ownerElement.Name];
- DTDAttributeDefinition attdef = elem == null ? null : elem.Attributes [node.Name];
+ DTDAttListDeclaration attList = doctype.DTD.AttListDecls [ownerElement.Name];
+ DTDAttributeDefinition attdef = attList == null ? null : attList.Get (node.Name);
if (attdef == null || attdef.Datatype.TokenizedType != XmlTokenizedType.ID)
return existing;