Files
mono/mcs/class/System.XML/System.Xml/XmlLinkedNode.cs
T
Atsushi Eno 099042bca0 *** empty log message ***
svn path=/trunk/mcs/; revision=8683
2002-10-30 19:41:13 +00:00

78 lines
1.3 KiB
C#

//
// 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
}
}