当前位置: 首页>>代码示例>>C#>>正文


C# Node.AdoptChild方法代码示例

本文整理汇总了C#中Nodes.Node.AdoptChild方法的典型用法代码示例。如果您正苦于以下问题:C# Node.AdoptChild方法的具体用法?C# Node.AdoptChild怎么用?C# Node.AdoptChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nodes.Node的用法示例。


在下文中一共展示了Node.AdoptChild方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: create

 private Node create(Node node, Node selectedNode, Node lastSelectedNode)
 {
     Node n = new Node();
     
     n.tagDeleted = node.tagDeleted;
     n.tokenType = node.tokenType;
     n.xmlTagName = node.xmlTagName;
     n.namespaceURI = node.namespaceURI;
     n.isVisible = node.isVisible;
     n.isGlyph = node.isGlyph;
     n.skip = node.skip;
     
     n.literalText = node.literalText;
     n.literalCaret = node.literalCaret;
     n.literalStart = node.literalStart;
     n.yOffset = node.yOffset;
     n.displayStyle = node.displayStyle;
     
     n.glyph = node.glyph;
     
     n.scriptLevel_ = node.scriptLevel_;
     
     n.type_ = node.type_;
     if (node.attrs != null)
     {
         n.attrs = new AttributeList();
         node.attrs.CopyTo(n.attrs);
     }
     n.FontStyle = node.FontStyle;
     if (node.style_ != null)
     {
         n.style_ = new StyleAttributes();
         node.style_.CopyTo(n.style_);
     }
     if (node == selectedNode)
     {
         this.selected_ = n;
     }
     if (node == lastSelectedNode)
     {
         this.lastSel_ = n;
     }
     if (node.HasChildren())
     {
         NodesList list = node.GetChildrenNodes();
         int count = list.Count;
         for (int i = 0; i < count; i++)
         {
             Node c = list.Get(i);
             Node child = this.create(c, selectedNode, lastSelectedNode);
             if (child != null)
             {
                 n.AdoptChild(child);
             }
         }
     }
     return n;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:58,代码来源:NodesInfo.cs

示例2: CreateChildGlyph

 private Node CreateChildGlyph(string sUnicode, Node node)
 {
     Node entityNode = null;
     try
     {
         entityNode = new Node();
         Node operatorNode = new Node();
         operatorNode.type_ = new global::Nodes.Type("mo", ElementType.Mo, 0, 0);
         entityNode.type_ = new global::Nodes.Type("entity", ElementType.Entity, 0, 0);
         Glyph glyph = null;
         glyph = this.entityManager.ByUnicode(sUnicode);
         if (glyph != null)
         {
             entityNode.literalText = "";
             entityNode.literalText = entityNode.literalText + glyph.CharValue;
             entityNode.fontFamily = glyph.FontFamily;
             entityNode.glyph = glyph;
             entityNode.xmlTagName = glyph.Name;
             entityNode.box = new Box_entity();
             operatorNode.box = new Box_Mo();
             node.CopyProperties(operatorNode);
             entityNode.scriptLevel_ = node.scriptLevel_;
             
             operatorNode.AdoptChild(entityNode);
             this.MeasureBox(entityNode, node.style_);
         }
     }
     catch
     {
         entityNode = null;
     }
     return entityNode;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:33,代码来源:Painter.cs

示例3: WrapInMrow

 //
 private Node WrapInMrow (Node node)
 {
     Node row = null;
     try
     {
         row = this.MakeNode ("mrow");
         node.AdoptChild (row);
         node.UpdateLevel ();
     }
     catch
     {
     }
     return row;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:15,代码来源:NodesBuilder.cs

示例4: ReParent

 //
 private bool ReParent (Node node, Node newParent)
 {
     try
     {
         Node oldParent = null;
         Node prev = null;
         Node next = null;
         oldParent = node.parent_;
         prev = node.prevSibling;
         next = node.nextSibling;
         if ((next == null) && (prev == null))
         {
             oldParent.firstChild = null;
             oldParent.lastChild = null;
             oldParent.numChildren = 0;
         }
         else if ((next != null) && (prev != null))
         {
             next.prevSibling = prev;
             prev.nextSibling = next;
             oldParent.numChildren--;
         }
         else if ((next != null) && (prev == null))
         {
             next.prevSibling = null;
             oldParent.firstChild = next;
             oldParent.numChildren--;
         }
         else if ((next == null) && (prev != null))
         {
             prev.nextSibling = null;
             oldParent.lastChild = prev;
             oldParent.numChildren--;
         }
         node.level = oldParent.level + 1;
         oldParent.UpdateChildrenIndices ();
         oldParent.UpdateLevel ();
         node.prevSibling = null;
         node.nextSibling = null;
         node.parent_ = null;
         newParent.AdoptChild (node);
         return true;
     }
     catch
     {
     }
     return false;
 }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:49,代码来源:NodesBuilder.cs


注:本文中的Nodes.Node.AdoptChild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。