コード例 #1
0
        public static CellValue GetOrderItemCellValue(CellsKind cell, Range orderItemRange, Worksheet invoice)
        {
            int offset    = CellsHelper.GetOffset(cell);
            var cellRange = invoice.Range.FromLTRB(orderItemRange.LeftColumnIndex + offset,
                                                   orderItemRange.TopRowIndex, orderItemRange.LeftColumnIndex + offset, orderItemRange.BottomRowIndex);

            return(cellRange.Value);
        }
コード例 #2
0
        public static void CreateCollectionEditor <T>(CellsKind cell, Worksheet invoice, IEnumerable <T> source, Func <T, string> getValue)
        {
            var cellInfo   = FindCell(cell);
            var cellValues = source.Select(x => CellValue.FromObject(getValue(x))).ToArray();

            invoice.CustomCellInplaceEditors.Add(invoice[cellInfo.CellRange], cellInfo.EditorType.Value,
                                                 ValueObject.CreateListSource(cellValues));
        }
コード例 #3
0
 public OrderCellInfo(CellsKind cell, string cellRange, CustomCellInplaceEditorType?editorType = null,
                      string editorId = null, CellValue[] fixedValues = null, int?offset = null, bool hasDependentCells = false)
 {
     Cell              = cell;
     CellRange         = cellRange;
     EditorType        = editorType;
     EditorId          = editorId;
     FixedValues       = fixedValues;
     Offset            = offset;
     HasDependentCells = hasDependentCells;
 }
コード例 #4
0
        public static CellValue GetOrderCellValue(CellsKind cell, List <OrderItem> orderItems, Worksheet invoice)
        {
            var range = CellsHelper.GetActualCellRange(CellsHelper.FindLeftCell(cell), orderItems.Any() ? orderItems.Count : 0);

            return(invoice.Cells[range].Value);
        }
コード例 #5
0
        public static void RemoveEditor(CellsKind cell, Worksheet invoice)
        {
            var storeCell = FindCell(cell);

            invoice.CustomCellInplaceEditors.Remove(invoice[storeCell.CellRange]);
        }
コード例 #6
0
 public static int GetOffset(CellsKind kind)
 {
     return(FindCell(kind).Offset.Value);
 }
コード例 #7
0
 public static string FindLeftCell(CellsKind cell)
 {
     return(FindLeftCell(cellsPosition[cell]));
 }
コード例 #8
0
 public static OrderCellInfo FindCell(CellsKind cell)
 {
     return(OrderCells.FirstOrDefault(x => x.Cell == cell) ?? OrderItemCells.FirstOrDefault(x => x.Cell == cell));
 }