| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- //
- // System.Xml.XmlLinkedNode
- //
- // Authors:
- // Jason Diamond <[email protected]>
- // Kral Ferch <[email protected]>
- //
- // (C) 2002 Jason Diamond, Kral Ferch
- //
- using System;
- namespace System.Xml
- {
- public abstract class XmlLinkedNode : XmlNode
- {
- #region Fields
- XmlLinkedNode nextSibling;
- XmlLinkedNode lastLinkedChild;
- #endregion
- #region Constructors
- internal XmlLinkedNode(XmlDocument doc) : base(doc) { }
- #endregion
- #region Properties
- public override XmlNode NextSibling
- {
- get {
- if(ParentNode == null) {
- return null;
- }
- else if (Object.ReferenceEquals(nextSibling, ParentNode.LastLinkedChild.NextLinkedSibling) == false) {
- return nextSibling;
- }
- else {
- return null;
- }
- }
- }
- internal XmlLinkedNode NextLinkedSibling
- {
- get { return nextSibling; }
- set { nextSibling = value; }
- }
- public override XmlNode PreviousSibling
- {
- get {
- if (ParentNode != null) {
- XmlNode node = ParentNode.FirstChild;
- if (node != this) {
- do {
- if (node.NextSibling == this)
- return node;
- } while ((node = node.NextSibling) != null);
- }
- }
- return null;
- }
- }
- // copied this way from XmlElement
- internal override XmlLinkedNode LastLinkedChild
- {
- get { return lastLinkedChild; }
- set { lastLinkedChild = value; }
- }
- #endregion
- }
- }
|