Esempio n. 1
0
        private void method_10(int value)
        {
            int count = this.Columns.Count;

            if (value > this.Rows.Count)
            {
                this.bool_0 = true;
                int num = value - this.Rows.Count;
                for (int index1 = 0; index1 < num; ++index1)
                {
                    DxfTableRow dxfTableRow = new DxfTableRow();
                    for (int index2 = 0; index2 < count; ++index2)
                    {
                        dxfTableRow.Cells.Add(new DxfTableCell());
                    }
                    this.Rows.Add(dxfTableRow);
                }
                this.bool_0 = false;
            }
            else
            {
                if (value >= this.Rows.Count)
                {
                    return;
                }
                this.bool_0 = true;
                int num = this.Rows.Count - value;
                for (int index = 0; index < num; ++index)
                {
                    this.Rows.RemoveAt(value);
                }
                this.bool_0 = false;
            }
        }
Esempio n. 2
0
        protected virtual void InitRowCells(int index, DxfTableRow item)
        {
            if (this.bool_0)
            {
                return;
            }
            int count = this.Columns.Count;

            if (item.Cells.Count < count)
            {
                int num = count - item.Cells.Count;
                for (int index1 = 0; index1 < num; ++index1)
                {
                    item.Cells.Add(new DxfTableCell());
                }
            }
            else if (item.Cells.Count > count)
            {
                throw new ArgumentException("More cells in row than ColumnCount.");
            }
        }
Esempio n. 3
0
 public Class1050(DxfTableRow row)
 {
     this.dxfTableRow_0 = row;
 }
Esempio n. 4
0
 private void method_17(object sender, int index, DxfTableRow item)
 {
     this.InitRowCells(index, item);
 }
Esempio n. 5
0
 private void method_16(object sender, int index, DxfTableRow oldItem, DxfTableRow newItem)
 {
     this.InitRowCells(index, newItem);
 }
Esempio n. 6
0
 internal void method_8(DxfTableRow row)
 {
     this.bool_0 = true;
     this.dxfTableRowCollection_0.Add(row);
     this.bool_0 = false;
 }
Esempio n. 7
0
        public void method_0(DxfTable table, DxfTableContent tableContent)
        {
            this.vector3D_0 = table.HorizontalDirection;
            int num = tableContent.RowCount;

            if (table.BreakData != null && table.BreakData.OptionFlags != TableBreakOptionFlags.None && table.BreakData.RowRanges.Count > 0)
            {
                num = table.BreakData.RowRanges[0].EndRowIndex + 1;
            }
            this.method_7(num, false);
            this.method_8(tableContent.ColumnCount, false);
            if (tableContent.TableStyle == null)
            {
                throw new ArgumentException("Table style is not set on table content.");
            }
            this.TableStyle           = tableContent.TableStyle;
            this.FlowDirection        = tableContent.FlowDirection;
            this.SuppressTitle        = tableContent.SuppressTitle == this.TableStyle.SuppressTitle ? new bool?() : new bool?(tableContent.SuppressTitle);
            this.SuppressHeaderRow    = tableContent.SuppressHeaderRow == this.TableStyle.SuppressHeaderRow ? new bool?() : new bool?(tableContent.SuppressHeaderRow);
            this.VerticalCellMargin   = !tableContent.CellStyleOverrides.OverrideVerticalMargin ? new double?() : new double?(tableContent.CellStyleOverrides.VerticalMargin);
            this.HorizontalCellMargin = !tableContent.CellStyleOverrides.OverrideHorizontalMargin ? new double?() : new double?(tableContent.CellStyleOverrides.HorizontalMargin);
            for (int rowIndex = 0; rowIndex < this.RowCount; ++rowIndex)
            {
                Class430    class430 = this.class429_0[rowIndex];
                DxfTableRow row      = tableContent.Rows[rowIndex];
                class430.Height = row.Height;
                for (int columnIndex = 0; columnIndex < this.ColumnCount; ++columnIndex)
                {
                    Class1026            cell1 = class430.Cells[columnIndex];
                    DxfTableCell         cell2 = row.Cells[columnIndex];
                    TableCellContentType tableCellContentType1 = TableCellContentType.Value;
                    DxfTableCellContent  tableCellContent      = (DxfTableCellContent)null;
                    DxfTableCellStyle    cellStyle             = this.GetCellStyle(rowIndex, columnIndex);
                    TableCellContentType tableCellContentType2;
                    if (cell2.Contents.Count > 0)
                    {
                        tableCellContentType1 = TableCellContentType.Value;
                        tableCellContentType1 = TableCellContentType.Value;
                        tableCellContent      = cell2.Contents[0];
                        tableCellContentType2 = tableCellContent.ContentType;
                        switch (tableCellContentType2)
                        {
                        case TableCellContentType.Value:
                        case TableCellContentType.Field:
                            break;

                        case TableCellContentType.Block:
                            cell1.CellType = Enum47.const_2;
                            cell1.Value.method_0(DxfValueFormat.GeneralInstance);
                            cell1.Value.method_1((object)null);
                            cell1.Value.method_2((string)null);
                            cell1.AutoFit    = table.GetAutoScale(rowIndex, columnIndex, -1);
                            cell1.BlockScale = table.GetBlockScale(rowIndex, columnIndex, -1);
                            cell1.Rotation   = table.GetRotation(rowIndex, columnIndex, -1);
                            if (tableCellContent != null)
                            {
                                cell1.BlockOrField = (DxfHandledObject)(tableCellContent.ValueObject as DxfBlock);
                                cell1.AutoFit      = table.GetAutoScale(rowIndex, columnIndex, 0);
                                cell1.BlockScale   = table.GetBlockScale(rowIndex, columnIndex, 0);
                                cell1.Rotation     = table.GetRotation(rowIndex, columnIndex, 0);
                                goto label_16;
                            }
                            else
                            {
                                goto label_16;
                            }

                        default:
                            goto label_16;
                        }
                    }
                    else
                    {
                        tableCellContentType1 = TableCellContentType.Value;
                        tableCellContentType2 = TableCellContentType.Value;
                    }
                    cell1.CellType = Enum47.const_1;
                    if (tableCellContent != null)
                    {
                        cell1.BlockOrField = tableCellContentType2 != TableCellContentType.Field ? (DxfHandledObject)null : tableCellContent.ValueObject;
                        cell1.Value.CopyFromShallow(tableCellContent.Value);
                        double?rotationOverride = table.GetRotationOverride(rowIndex, columnIndex, 0, cellStyle);
                        cell1.Rotation   = rotationOverride.HasValue ? rotationOverride.Value : 0.0;
                        cell1.TextStyle  = table.GetTextStyleOverride(rowIndex, columnIndex, 0, cellStyle);
                        cell1.TextHeight = table.GetTextHeightOverride(rowIndex, columnIndex, 0, cellStyle);
                    }
                    else
                    {
                        cell1.BlockOrField = (DxfHandledObject)null;
                        if (cell2.Contents.Count > 0)
                        {
                            cell1.Value.CopyFromShallow(cell2.Contents[0].Value);
                        }
                        double?rotationOverride = table.GetRotationOverride(rowIndex, columnIndex, -1, cellStyle);
                        cell1.Rotation   = rotationOverride.HasValue ? rotationOverride.Value : 0.0;
                        cell1.TextStyle  = table.GetTextStyleOverride(rowIndex, columnIndex, -1, cellStyle);
                        cell1.TextHeight = table.GetTextHeightOverride(rowIndex, columnIndex, -1, cellStyle);
                    }
label_16:
                    cell1.CellAlignment = table.GetCellAlignmentOverride(rowIndex, columnIndex, -1, cellStyle);
                    Color?contentColorOverride = table.GetContentColorOverride(rowIndex, columnIndex, -1, cellStyle);
                    cell1.ContentColor = contentColorOverride.HasValue ? new Color?(contentColorOverride.Value) : new Color?();
                    Color?backColor = table.GetBackColor(rowIndex, columnIndex);
                    if (backColor.HasValue)
                    {
                        cell1.BackColor          = new Color?(backColor.Value);
                        cell1.IsBackColorEnabled = new bool?(true);
                    }
                    else
                    {
                        cell1.BackColor          = new Color?();
                        cell1.IsBackColorEnabled = new bool?();
                    }
                    for (int borderIndex = 0; borderIndex < 4; ++borderIndex)
                    {
                        DxfTableBorder          dxfTableBorder       = cell2.CellStyleOverrides.method_21(borderIndex + 2);
                        DxfTableBorderOverrides tableBorderOverrides = cell1.method_6(borderIndex);
                        tableBorderOverrides.Color      = !dxfTableBorder.OverrideColor ? new Color?() : new Color?(dxfTableBorder.Color);
                        tableBorderOverrides.LineWeight = !dxfTableBorder.OverrideLineWeight ? new short?() : new short?(dxfTableBorder.LineWeight);
                        tableBorderOverrides.Visible    = !dxfTableBorder.OverrideVisibility ? new bool?() : new bool?(dxfTableBorder.Visible);
                    }
                }
            }
            for (int index = 0; index < this.ColumnCount; ++index)
            {
                this.class912_0[index].Width = tableContent.Columns[index].Width;
            }
            foreach (DxfTableCellRange mergedCellRange in (List <DxfTableCellRange>)tableContent.MergedCellRanges)
            {
                if ((mergedCellRange.TopRowIndex != mergedCellRange.BottomRowIndex || mergedCellRange.LeftColumnIndex != mergedCellRange.RightColumnIndex) && (mergedCellRange.TopRowIndex < this.RowCount && mergedCellRange.LeftColumnIndex < this.ColumnCount))
                {
                    Class1026 cell = this.class429_0[mergedCellRange.TopRowIndex].Cells[mergedCellRange.LeftColumnIndex];
                    cell.MergedCellCountHorizontal = mergedCellRange.RightColumnIndex - mergedCellRange.LeftColumnIndex + 1;
                    cell.MergedCellCountVertical   = mergedCellRange.BottomRowIndex - mergedCellRange.TopRowIndex + 1;
                }
            }
        }