public void Create(PrintElementNodeBuilder builder, ICollection <PrintElementNode> elements, PrintElementNode elementNode) { elementNode.ElementChildrenTypes = TableCells; elementNode.CanInsertChild = BuildHelper.CanInsertChild(elementNode); elementNode.InsertChild = BuildHelper.InsertChildToContainer(builder, elements, elementNode, "Header", false); elementNode.CanDeleteChild = BuildHelper.CanDeleteChild(elementNode); elementNode.DeleteChild = BuildHelper.DeleteChildFromContainer(elements, elementNode, "Header", false); elementNode.CanPaste = BuildHelper.CanPaste(elementNode); elementNode.Paste = BuildHelper.Paste(elementNode); builder.BuildElement(elements, elementNode, elementNode.ElementMetadata.Header, "TableCell"); }
private static Func <PrintElementNode, bool> CanInsertTableRowCell(PrintElementNode parentElementNode) { // Добавление ячейки в строку возможно, если количество ячеек в строке меньше количества столбцов var getColumnCountFunc = GetTableColumnCount(parentElementNode); var getTableRowCellCountFunc = GetTableRowCellCount(parentElementNode); var canInsertChildFunc = BuildHelper.CanInsertChild(parentElementNode); return(cellElementNode => { var columnCount = getColumnCountFunc(); var rowCellCount = getTableRowCellCountFunc(); return (rowCellCount < columnCount) && canInsertChildFunc(cellElementNode); }); }
public void Create(PrintElementNodeBuilder builder, ICollection <PrintElementNode> elements, PrintElementNode elementNode) { elementNode.ElementChildrenTypes = BuildHelper.BlockTypes; elementNode.CanInsertChild = BuildHelper.CanInsertChild(elementNode); elementNode.InsertChild = BuildHelper.InsertChildToContainer(builder, elements, elementNode, "ItemTemplate"); elementNode.CanDeleteChild = BuildHelper.CanDeleteChild(elementNode); elementNode.DeleteChild = BuildHelper.DeleteChildFromContainer(elements, elementNode, "ItemTemplate"); elementNode.CanPaste = BuildHelper.CanPaste(elementNode); elementNode.Paste = BuildHelper.Paste(elementNode); builder.BuildElement(elements, elementNode, elementNode.ElementMetadata.ItemTemplate); }
public void Create(PrintElementNodeBuilder builder, ICollection <PrintElementNode> elements, PrintElementNode elementNode) { elementNode.ElementChildrenTypes = BuildHelper.BlockTypes; elementNode.CanInsertChild = BuildHelper.CanInsertChild(elementNode); elementNode.InsertChild = BuildHelper.InsertChildToCollection(builder, elements, elementNode, "Blocks"); elementNode.CanDeleteChild = BuildHelper.CanDeleteChild(elementNode); elementNode.DeleteChild = BuildHelper.DeleteChildFromCollection(elements, elementNode, "Blocks"); elementNode.CanMoveChild = BuildHelper.CanMoveChild(elementNode); elementNode.MoveChild = BuildHelper.MoveChildInCollection(elementNode, "Blocks"); elementNode.CanPaste = BuildHelper.CanPaste(elementNode); elementNode.Paste = BuildHelper.Paste(elementNode); builder.BuildElements(elements, elementNode, elementNode.ElementMetadata.Blocks); }
public void Create(PrintElementNodeBuilder builder, ICollection <PrintElementNode> elements, PrintElementNode elementNode) { elementNode.ElementChildrenTypes = TableColumns; elementNode.CanInsertChild = BuildHelper.CanInsertChild(elementNode); elementNode.InsertChild = InsertTableColumn(builder, elements, elementNode); elementNode.CanDeleteChild = BuildHelper.CanDeleteChild(elementNode); elementNode.DeleteChild = DeleteTableColumn(elements, elementNode); elementNode.CanMoveChild = BuildHelper.CanMoveChild(elementNode); elementNode.MoveChild = MoveTableColumn(elementNode); elementNode.CanPaste = BuildHelper.CanPaste(elementNode); elementNode.Paste = BuildHelper.Paste(elementNode); builder.BuildElements(elements, elementNode, elementNode.ElementMetadata.Columns, "TableColumn"); }