當前位置: 首頁>>代碼示例>>C#>>正文


C# Node.EmbraceParent方法代碼示例

本文整理匯總了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;
 }
開發者ID:xuchuansheng,項目名稱:GenXSource,代碼行數:40,代碼來源:Node.cs

示例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();
        }
開發者ID:xuchuansheng,項目名稱:GenXSource,代碼行數:41,代碼來源:Node.cs

示例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;
 }
開發者ID:xuchuansheng,項目名稱:GenXSource,代碼行數:30,代碼來源:Node.cs


注:本文中的Nodes.Node.EmbraceParent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。