本文整理汇总了C#中Nodes.Node.EmbraceParent方法的典型用法代码示例。如果您正苦于以下问题:C# Node.EmbraceParent方法的具体用法?C# Node.EmbraceParent怎么用?C# Node.EmbraceParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nodes.Node
的用法示例。
在下文中一共展示了Node.EmbraceParent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AppendNode
public bool AppendNode(Node node)
{
if (! (((parent_ != null) && (parent_.type_ != null)) && (node.type_ != null)))
{
return false;
}
Node nextSibling = this.nextSibling;
Node parent = this.parent_;
node.level = parent.level + 1;
if (nextSibling == null)
{
node.childIndex = childIndex + 1;
node.prevSibling = this;
node.nextSibling = null;
node.parent_ = parent;
parent.lastChild = node;
this.nextSibling = node;
}
else
{
node.childIndex = childIndex + 1;
node.prevSibling = this;
nextSibling.prevSibling = node;
node.nextSibling = nextSibling;
node.parent_ = parent;
this.nextSibling = node;
while (nextSibling != null)
{
nextSibling.childIndex++;
nextSibling = nextSibling.nextSibling;
}
}
if (HasStyleClass() && (StyleClass.Length > 0))
{
node.StyleClass = StyleClass;
}
node.EmbraceParent();
parent.numChildren++;
return true;
}
示例2: ReplaceChild
public void ReplaceChild(Node oldChild, Node newChild)
{
newChild.prevSibling = oldChild.prevSibling;
newChild.nextSibling = oldChild.nextSibling;
newChild.lowerNode = oldChild.lowerNode;
newChild.upperNode = oldChild.upperNode;
if (oldChild.prevSibling != null)
{
oldChild.prevSibling.nextSibling = newChild;
}
if (oldChild.nextSibling != null)
{
oldChild.nextSibling.prevSibling = newChild;
}
if (oldChild.upperNode != null)
{
oldChild.upperNode.lowerNode = newChild;
}
if (oldChild.lowerNode != null)
{
oldChild.lowerNode.upperNode = newChild;
}
if (firstChild == oldChild)
{
firstChild = newChild;
}
if (lastChild == oldChild)
{
lastChild = newChild;
}
newChild.level = oldChild.level;
newChild.childIndex = oldChild.childIndex;
newChild.displayStyle = displayStyle;
newChild.glyph = glyph;
newChild.scriptLevel_ = scriptLevel_;
newChild.parent_ = this;
newChild.EmbraceParent();
}
示例3: AdoptChild
public bool AdoptChild(Node ChildNode)
{
if (! ((type_ != null) && (ChildNode.type_ != null)))
{
return false;
}
Node node = lastChild;
ChildNode.level = level + 1;
if (node != null)
{
ChildNode.childIndex = node.childIndex + 1;
ChildNode.prevSibling = node;
ChildNode.nextSibling = null;
ChildNode.parent_ = this;
lastChild = ChildNode;
node.nextSibling = ChildNode;
}
else
{
ChildNode.childIndex = 0;
ChildNode.prevSibling = null;
ChildNode.nextSibling = null;
ChildNode.parent_ = this;
firstChild = ChildNode;
lastChild = ChildNode;
}
numChildren++;
ChildNode.EmbraceParent();
return true;
}