コード例 #1
0
 //
 public Node CarriageReturn (Node node, ref bool wasSplit)
 {
     if ((((node.literalText == null) || (node.InternalMark <= 0))) ||
         (node.InternalMark >= node.LiteralLength))
     {
         return node;
     }
     if (((node.parent_ != null)) &&
         ((node.parent_.numChildren == node.parent_.type_.maxChilds) ||
          (node.parent_.type_.type == ElementType.Mmultiscripts)))
     {
         node = this.WrapInRowInplace (node);
     }
     Node newNode = new Node (node.xmlTagName);
     node.CopyProperties (newNode);
     newNode.InternalMark = 0;
     newNode.literalText = node.literalText.Substring (node.InternalMark, node.literalText.Length - node.InternalMark);
     node.literalText = node.literalText.Substring (0, node.InternalMark);
     node.AppendNode (newNode);
     node.parent_.UpdateChildrenIndices ();
     node.parent_.UpdateLevel ();
     newNode.InternalMark = 0;
     wasSplit = true;
     return newNode;
 }