示例#1
0
文件: Class1071.cs 项目: 15831944/WW
 public Class1071(DxfTableBorder border)
 {
     this.dxfTableBorder_0 = border;
 }
示例#2
0
文件: Class551.cs 项目: 15831944/WW
        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;
                }
            }
        }