本文整理汇总了C#中Nodes.Node.CopyProperties方法的典型用法代码示例。如果您正苦于以下问题:C# Node.CopyProperties方法的具体用法?C# Node.CopyProperties怎么用?C# Node.CopyProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nodes.Node
的用法示例。
在下文中一共展示了Node.CopyProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: CarriageReturn
//
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;
}