8 internal struct SmallXmlNodeList
12 private object loneValue;
14 private int position = -1;
28 public SingleObjectEnumerator(
object value)
33 public bool MoveNext()
64 public object this[
int index]
73 if (arrayList !=
null)
75 return arrayList[index];
85 public void Add(
object value)
102 if (arrayList2 !=
null)
104 arrayList2.
Add(value);
108 arrayList2.
Add(field);
109 arrayList2.
Add(value);
113 public void RemoveAt(
int index)
120 if (arrayList !=
null)
132 public void Insert(
int index,
object value)
144 if (arrayList !=
null)
146 arrayList.
Insert(index, value);
153 arrayList.
Add(value);
154 arrayList.
Add(field);
159 arrayList.
Add(field);
160 arrayList.
Add(value);
175 if (arrayList !=
null)
179 return new SingleObjectEnumerator(field);
185 internal SmallXmlNodeList nodes;
189 public virtual int Count => nodes.Count;
193 this.parent = parent;
201 int num = FindNodeOffset(name);
225 return ReplaceNodeAt(num, node);
233 int num = FindNodeOffset(name);
236 return RemoveNodeAt(num);
246 if (index < 0 || index >= nodes.Count)
266 int num = FindNodeOffset(localName, namespaceURI);
280 int num = FindNodeOffset(localName, namespaceURI);
283 return RemoveNodeAt(num);
292 return nodes.GetEnumerator();
295 internal int FindNodeOffset(
string name)
298 for (
int i = 0; i < count; i++)
301 if (name == xmlNode.
Name)
309 internal int FindNodeOffset(
string localName,
string namespaceURI)
312 for (
int i = 0; i < count; i++)
314 XmlNode xmlNode = (XmlNode)nodes[i];
315 if (xmlNode.LocalName == localName && xmlNode.NamespaceURI == namespaceURI)
323 internal virtual XmlNode AddNode(XmlNode node)
325 XmlNode oldParent = (node.NodeType !=
XmlNodeType.Attribute) ? node.ParentNode : ((XmlAttribute)node).OwnerElement;
326 string value = node.Value;
327 XmlNodeChangedEventArgs eventArgs = parent.GetEventArgs(node, oldParent, parent, value, value,
XmlNodeChangedAction.Insert);
328 if (eventArgs !=
null)
330 parent.BeforeEvent(eventArgs);
333 node.SetParent(parent);
334 if (eventArgs !=
null)
336 parent.AfterEvent(eventArgs);
341 internal virtual XmlNode AddNodeForLoad(XmlNode node, XmlDocument doc)
343 XmlNodeChangedEventArgs insertEventArgsForLoad = doc.GetInsertEventArgsForLoad(node, parent);
344 if (insertEventArgsForLoad !=
null)
346 doc.BeforeEvent(insertEventArgsForLoad);
349 node.SetParent(parent);
350 if (insertEventArgsForLoad !=
null)
352 doc.AfterEvent(insertEventArgsForLoad);
357 internal virtual XmlNode RemoveNodeAt(
int i)
359 XmlNode xmlNode = (XmlNode)nodes[i];
360 string value = xmlNode.Value;
361 XmlNodeChangedEventArgs eventArgs = parent.GetEventArgs(xmlNode, parent,
null, value, value,
XmlNodeChangedAction.Remove);
362 if (eventArgs !=
null)
364 parent.BeforeEvent(eventArgs);
367 xmlNode.SetParent(
null);
368 if (eventArgs !=
null)
370 parent.AfterEvent(eventArgs);
375 internal XmlNode ReplaceNodeAt(
int i, XmlNode node)
377 XmlNode result = RemoveNodeAt(i);
378 InsertNodeAt(i, node);
382 internal virtual XmlNode InsertNodeAt(
int i, XmlNode node)
384 XmlNode oldParent = (node.NodeType !=
XmlNodeType.Attribute) ? node.ParentNode : ((XmlAttribute)node).OwnerElement;
385 string value = node.Value;
386 XmlNodeChangedEventArgs eventArgs = parent.GetEventArgs(node, oldParent, parent, value, value,
XmlNodeChangedAction.Insert);
387 if (eventArgs !=
null)
389 parent.BeforeEvent(eventArgs);
391 nodes.Insert(i, node);
392 node.SetParent(parent);
393 if (eventArgs !=
null)
395 parent.AfterEvent(eventArgs);
Represents an XML document. You can use this class to load, validate, edit, add, and position XML in ...
abstract string LocalName
Gets the local name of the node, when overridden in a derived class.
virtual void Insert(int index, object value)
Inserts an element into the T:System.Collections.ArrayList at the specified index.
virtual void RemoveAt(int index)
Removes the element at the specified index of the T:System.Collections.ArrayList.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
virtual XmlNode RemoveNamedItem(string localName, string namespaceURI)
Removes a node with the matching P:System.Xml.XmlNode.LocalName and P:System.Xml.XmlNode....
XmlNodeType
Specifies the type of node.
virtual IEnumerator GetEnumerator()
Provides support for the "foreach" style iteration over the collection of nodes in the XmlNamedNodeMa...
virtual string NamespaceURI
Gets the namespace URI of this node.
Represents a collection of nodes that can be accessed by name or index.
Exposes an enumerator, which supports a simple iteration over a non-generic collection....
The exception that is thrown when an attempt is made to access an element of an array or collection w...
virtual XmlNode Item(int index)
Retrieves the node at the specified index in the XmlNamedNodeMap.
XmlNodeChangedAction
Specifies the type of node change.
virtual XmlNode GetNamedItem(string name)
Retrieves an T:System.Xml.XmlNode specified by name.
The Add key (the addition key on the numeric keypad).
virtual int Add(object value)
Adds an object to the end of the T:System.Collections.ArrayList.
virtual int Count
Gets the number of nodes in the XmlNamedNodeMap.
virtual XmlNode GetNamedItem(string localName, string namespaceURI)
Retrieves a node with the matching P:System.Xml.XmlNode.LocalName and P:System.Xml....
virtual XmlNode SetNamedItem(XmlNode node)
Adds an T:System.Xml.XmlNode using its P:System.Xml.XmlNode.Name property.
A node is being inserted in the tree.
virtual IEnumerator GetEnumerator()
Returns an enumerator for the entire T:System.Collections.ArrayList.
The exception that is thrown when a method call is invalid for the object's current state.
Represents a single node in the XML document.
abstract string Name
Gets the qualified name of the node, when overridden in a derived class.
Supports a simple iteration over a non-generic collection.
Implements the T:System.Collections.IList interface using an array whose size is dynamically increase...
virtual XmlNode RemoveNamedItem(string name)
Removes the node from the XmlNamedNodeMap.