Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
        private static Func <PrintElementNode, bool, bool> CanDeleteTableRowCell(PrintElementNode parentElementNode)
        {
            // Удаление ячейки из строки возможно, если количество ячеек в строке больше количества столбцов

            var getColumnCountFunc       = GetTableColumnCount(parentElementNode);
            var getTableRowCellCountFunc = GetTableRowCellCount(parentElementNode);
            var canDeleteChildFunc       = BuildHelper.CanDeleteChild(parentElementNode);

            return((cellElementNode, accept) =>
            {
                var columnCount = getColumnCountFunc();
                var rowCellCount = getTableRowCellCountFunc();
                return (rowCellCount > columnCount) && canDeleteChildFunc(cellElementNode, accept);
            });
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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");
        }