本文整理汇总了C#中Nodes.Node.GetChildrenNodes方法的典型用法代码示例。如果您正苦于以下问题:C# Node.GetChildrenNodes方法的具体用法?C# Node.GetChildrenNodes怎么用?C# Node.GetChildrenNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nodes.Node
的用法示例。
在下文中一共展示了Node.GetChildrenNodes方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: FillBackground
public void FillBackground(Node node)
{
if (node.HasChildren())
{
NodesList nodesList = node.GetChildrenNodes();
Node n = nodesList.Next();
int x = 0;
int y = 0;
int w = 0;
int h = 0;
while (n != null)
{
if (n.NotOnWhite())
{
x = n.box.X;
y = n.box.Y;
w = n.box.Width;
h = n.box.Height;
int count = 0;
while (((n.nextSibling != null) && n.nextSibling.NotOnWhite()) && (n.nextSibling.Background == n.Background))
{
n = n.nextSibling;
if (n.box.Y < y)
{
h += y - n.box.Y;
y = n.box.Y;
}
if ((n.box.X + n.box.Width) > (x + w))
{
w = (n.box.X + n.box.Width) - x;
}
if ((n.box.Y + n.box.Height) > (y + h))
{
h = (n.box.Y + n.box.Height) - y;
}
count++;
}
if (count > 0)
{
this.FillRectangle(x, y, w, h, n.Background);
}
}
if (n != null)
{
n = nodesList.Next();
}
}
}
}
示例3: TagAsDeleted
//
private void TagAsDeleted (Node node)
{
if (node.HasChildren ())
{
NodesList list = node.GetChildrenNodes ();
for (int i = 0; i < list.Count; i++)
{
Node n = list.Get (i);
if (n != null)
{
this.TagAsDeleted (n);
}
}
}
node.tagDeleted = true;
node = null;
}
示例4: ChildNodeFromPoint
//
private Node ChildNodeFromPoint (Node Parent_Node, int x, int y, CaretLocation result)
{
Node node = null;
try
{
bool done = false;
int i = 0;
NodesList childrenNodes = null;
childrenNodes = Parent_Node.GetChildrenNodes ();
int count = 0;
if (childrenNodes == null)
{
return node;
}
count = childrenNodes.Count;
while (!done && (i < count))
{
Node child = null;
child = childrenNodes.Get (i);
if ((child != null) && child.isVisible)
{
if ((x >= child.box.X) && (x <= (child.box.X + (child.box.Width / 2))))
{
node = child;
result.pos = CaretPosition.Left;
done = true;
}
else if ((x >= (child.box.X + (child.box.Width / 2))) && (x <= (child.box.X + child.box.Width)))
{
node = child;
result.pos = CaretPosition.Right;
done = true;
}
}
i++;
}
if ((!done && (Parent_Node.lastChild != null)) && Parent_Node.lastChild.isVisible)
{
node = Parent_Node.lastChild;
}
}
catch
{
}
return node;
}
示例5: PropogateAttributes
//
private void PropogateAttributes (Node trNode1, Node trNode2)
{
try
{
if ((trNode1.type_.type != ElementType.Mtr) ||
(trNode2.type_.type != ElementType.Mtr))
{
return;
}
NodesList list1 = trNode1.GetChildrenNodes ();
NodesList list2 = trNode2.GetChildrenNodes ();
if (list1.Count != list2.Count)
{
return;
}
for (int i = 0; i < list1.Count; i++)
{
if (i < list2.Count)
{
Node child1 = list1.Get (i);
Node child2 = list2.Get (i);
if (child1.attrs != null)
{
child1.attrs.Reset ();
try
{
for (int j = 0; j < child1.attrs.Count; j++)
{
Nodes.Attribute attr1 = child1.attrs.Next ();
Nodes.Attribute attr2 = new Nodes.Attribute (attr1.name, attr1.val, attr1.ns);
if (child2.attrs == null)
{
child2.attrs = new AttributeList ();
}
child2.attrs.Add (attr2);
}
}
catch
{
}
child1.attrs.Reset ();
if (child2.attrs != null)
{
child2.attrs.Reset ();
}
}
}
}
}
catch
{
}
}
示例6: IsEmptyRow
//
private bool IsEmptyRow (Node trNode)
{
bool r = false;
try
{
if (trNode.type_.type != ElementType.Mtr)
{
return r;
}
NodesList list = trNode.GetChildrenNodes ();
int i = 0;
while ((i < list.Count) && this.IsEmptyCell (list.Get (i)))
{
i++;
}
if (i == list.Count)
{
r = true;
}
}
catch
{
}
return r;
}
示例7: MTable
public MTable(Node node)
{
this.colColSpan = 0;
this.totalHorzFrameSpacing = 0;
this.totalWidth = 0;
this.minWidth = 30;
this.totalVertFrameSpacing = 0;
this.tableAlign = 0;
this.rowFrameSpacing = 0;
this.colFrameSpacing = 0;
this.maxWidth = 0;
this.curRow = 0;
this.curCol = 0;
this.selKind_ = TableCellKind.SelAll;
this.displayStyle = false;
this.equalRows = false;
this.equalColumns = false;
this.align = TableAlign.AXIS;
this.frame = TableLineStyle.NONE;
this.framespacing = "0.4em 0.5ex";
this.side = Side.RIGHT;
this.minlabelSpacing = "0.8em";
this.colLines = new TableLineStyle[] { TableLineStyle.NONE };
this.colSpacing = new string[] { "0.8em" };
this.colAligns = new HAlign[] { HAlign.CENTER };
this.rowAligns = new RowAlign[] { RowAlign.BASELINE };
this.node_ = node;
this.attrs = AttributeBuilder.mtableAttributes(node);
if (this.attrs != null)
{
this.rowAligns = this.attrs.rowAligns;
this.colAligns = this.attrs.colAligns;
this.colLines = this.attrs.colLines;
this.colSpacing = this.attrs.colSpacing;
this.displayStyle = this.attrs.displaystyle;
this.equalRows = this.attrs.equalRows;
this.equalColumns = this.attrs.equalColumns;
this.align = this.attrs.align;
this.frame = this.attrs.frame;
this.framespacing = this.attrs.framespacing;
this.side = this.attrs.side;
this.minlabelSpacing = this.attrs.minlabelspacing;
}
this.rows = new ArrayList();
if (node.HasChildren())
{
NodesList nodesList = node.GetChildrenNodes();
Node n = nodesList.Next();
for (int i = 0; n != null; i++)
{
MRow row = this.AddRow(n, i);
if (this.attrs != null)
{
if (i < this.attrs.rowSpacing.Length)
{
row.spacing = this.attrs.rowSpacing[i];
}
else if (this.attrs.rowSpacing.Length > 0)
{
row.spacing = this.attrs.rowSpacing[this.attrs.rowSpacing.Length - 1];
}
if (i < this.attrs.rowLines.Length)
{
row.lines = this.attrs.rowLines[i];
}
else if (this.attrs.rowLines.Length > 0)
{
row.lines = this.attrs.rowLines[this.attrs.rowLines.Length - 1];
}
}
if (row.attrs != null)
{
row.colAligns = row.attrs.colAligns;
row.align = row.attrs.align;
}
if (n.HasChildren())
{
NodesList list = n.GetChildrenNodes();
Node child = list.Next();
int colSpan = 0;
if (n.type_.type == ElementType.Mlabeledtr)
{
row.isLabeled = true;
MCell cell = row.AddLabel(child, n.numChildren - 1);
if (cell.tableAttrs != null)
{
cell.rowAlign = cell.tableAttrs.rowAlign;
cell.columnAlign = cell.tableAttrs.columnAlign;
cell.columnSpan = cell.tableAttrs.columnSpan;
cell.rowSpan = cell.tableAttrs.rowSpan;
}
child = list.Next();
}
while (child != null)
{
MCell cell = row.AddCell(child, colSpan);
if (cell.tableAttrs != null)
{
cell.rowAlign = cell.tableAttrs.rowAlign;
cell.columnAlign = cell.tableAttrs.columnAlign;
//.........这里部分代码省略.........
示例8: tryAddMathXML
//.........这里部分代码省略.........
bool wasSelect = false;
Node lastRow = null;
if (!((xmlRoot == null) || !xmlRoot.HasChildNodes))
{
Node selRow = selectedNode;
int count = 0;
count = xmlRoot.ChildNodes.Count;
int rCount = 0;
if (((selRow.type_ != null) && (selRow.type_.type == ElementType.Mrow)) && !selRow.HasChildren())
{
emptyRow = true;
rCount = 1;
}
if ((((selRow.parent_ != null)) &&
((selRow.parent_.type_.maxChilds != -1) &&
(((selRow.parent_.numChildren - rCount) + count) >= selRow.parent_.type_.maxChilds))) ||
((selRow.parent_.type_.type == ElementType.Mmultiscripts) ||
(selRow.parent_.type_.type == ElementType.Maction)))
{
selRow = this.WrapInRowInplace(selRow);
}
if (selRow.IsAppend)
{
Node row = selRow;
Node lastCell = null;
if (isPaste && (xmlRoot.Name == "math"))
{
Node newNode = new Node();
newNode.Parse(xmlRoot, this.types_, this.entityManager, true, null);
if ((newNode.type_ != null) && newNode.HasChildren())
{
NodesList list = newNode.GetChildrenNodes();
Node n = list.Next();
lastRow = row;
for (int i = 0; (row != null) && (n != null); i++)
{
row.AppendNode(n);
lastCell = n;
n = list.Next();
row = row.nextSibling;
}
if (lastCell != null)
{
if (lastCell.nextSibling != null)
{
this.SelectNode(lastCell.nextSibling, false);
}
else
{
this.SelectNode(lastCell, true);
}
wasSelect = true;
}
}
}
else
{
for (int i = 0; i < count; i++)
{
XmlNode x = xmlRoot.ChildNodes[i];
Node n = new Node();
n.Parse(x, this.types_, this.entityManager, false, null);
if (n.type_ != null)
{
示例9: Draw
public override void Draw(Node node, PaintMode printMode, Color color)
{
if ((printMode == PaintMode.BACKGROUND))
{
base.painter_.FillRectangle(node);
}
else if ((printMode == PaintMode.FOREGROUND))
{
if (node.NotBlack())
{
color = node.style_.color;
}
if (this.attrs != null)
{
if (this.attrs.open.Length > 0)
{
base.painter_.DrawFence(node, this.attrs.open, color);
}
if (this.attrs.close.Length > 0)
{
int x = node.box.X;
int w = node.box.Width;
try
{
node.box.X = (x + w) - this.closeWidth;
node.box.Width = this.closeWidth;
base.painter_.DrawFence(node, this.attrs.close, color);
}
catch
{
}
node.box.X = x;
node.box.Width = w;
}
}
int b = base.painter_.MeasureBaseline(node, node.style_, ",");
NodesList nodesList = node.GetChildrenNodes();
if (nodesList != null)
{
Node next = nodesList.Next();
if (next != null)
{
next = nodesList.Next();
}
while (next != null)
{
int xoff = 2;
try
{
xoff = this.leading / 3;
}
catch
{
}
if (this.Separator(next) != "")
{
base.painter_.DrawString(next, next.style_, (next.box.X - this.SeparatorWidth(next)) + xoff, (base.rect.y + base.rect.baseline) - b, 0, 0, this.Separator(next), color);
}
next = nodesList.Next();
}
}
}
}