private DxfMessage method_20( int rowIndex, int columnIndex, Class1026 cell, DxfTableBorderOverrides border, TableCellEdgeFlags edgeFlags) { return(new DxfMessage(DxfStatus.TableSharedBorderOverrideConflict, Severity.Error, nameof(cell), (object)cell) { Parameters = { { nameof(border), (object)border }, { "top", (object)edgeFlags }, { "row", (object)rowIndex }, { "column", (object)columnIndex } } }); }
internal void method_9( DxfVersion version, Class1026 cell, int rowIndex, int columnIndex, DxfXRecord cellRoundTripData, out double checksum, out int overrideFlags, out int extendedFlags) { checksum = this.method_10(cell.Value.Format._FormatString); byte edgeFlags; byte virtualEdgeFlags; int borderTopFlags; int borderRightFlags; int borderBottomFlags; int borderLeftFlags; this.method_11(version, cell, rowIndex, columnIndex, out edgeFlags, out virtualEdgeFlags, out overrideFlags, out borderTopFlags, out borderRightFlags, out borderBottomFlags, out borderLeftFlags); extendedFlags = cell.ExtendedFlags; cell.Value.Write(cellRoundTripData); }
public bool Validate(DxfModel model, IList <DxfMessage> messages) { bool flag = true; for (int rowIndex = 0; rowIndex < this.RowCount; ++rowIndex) { for (int columnIndex = 0; columnIndex < this.ColumnCount; ++columnIndex) { Class1026 cell = this.class429_0[rowIndex].Cells[columnIndex]; if (rowIndex > 0 && cell.BorderTop.method_0(DxfVersion.Dxf27) && this.class429_0[rowIndex - 1].Cells[columnIndex].BorderBottom.method_0(DxfVersion.Dxf27)) { DxfMessage dxfMessage = this.method_20(rowIndex, columnIndex, cell, cell.BorderTop, TableCellEdgeFlags.Top); messages.Add(dxfMessage); flag = false; } if (rowIndex < this.RowCount - 1 && cell.BorderBottom.method_0(DxfVersion.Dxf27) && this.class429_0[rowIndex + 1].Cells[columnIndex].BorderTop.method_0(DxfVersion.Dxf27)) { DxfMessage dxfMessage = this.method_20(rowIndex, columnIndex, cell, cell.BorderBottom, TableCellEdgeFlags.Bottom); messages.Add(dxfMessage); flag = false; } if (columnIndex > 0 && cell.BorderLeft.method_0(DxfVersion.Dxf27) && this.class429_0[rowIndex].Cells[columnIndex - 1].BorderRight.method_0(DxfVersion.Dxf27)) { DxfMessage dxfMessage = this.method_20(rowIndex, columnIndex, cell, cell.BorderLeft, TableCellEdgeFlags.Left); messages.Add(dxfMessage); flag = false; } if (columnIndex < this.ColumnCount - 1 && cell.BorderRight.method_0(DxfVersion.Dxf27) && this.class429_0[rowIndex].Cells[columnIndex + 1].BorderLeft.method_0(DxfVersion.Dxf27)) { DxfMessage dxfMessage = this.method_20(rowIndex, columnIndex, cell, cell.BorderRight, TableCellEdgeFlags.Right); messages.Add(dxfMessage); flag = false; } } } return(flag); }
private void method_3(object sender, int index, Class1026 item) { item.method_3(this); }
private void method_2(object sender, int index, Class1026 item) { item.method_3((Class430)null); }
private void method_1(object sender, int index, Class1026 oldItem, Class1026 newItem) { oldItem.method_3((Class430)null); newItem.method_3(this); }
internal void method_11( DxfVersion version, Class1026 cell, int rowIndex, int columnIndex, out byte edgeFlags, out byte virtualEdgeFlags, out int overrideFlags, out int borderTopFlags, out int borderRightFlags, out int borderBottomFlags, out int borderLeftFlags) { edgeFlags = (byte)0; virtualEdgeFlags = (byte)0; borderTopFlags = this.method_12(version, cell.BorderTop); if (borderTopFlags != 0) { edgeFlags |= (byte)1; } else if (rowIndex > 0 && this.Rows[rowIndex - 1].Cells[columnIndex].BorderBottom.method_0(version)) { edgeFlags |= (byte)1; virtualEdgeFlags |= (byte)1; } borderRightFlags = this.method_12(version, cell.BorderRight); if (borderRightFlags != 0) { edgeFlags |= (byte)2; } else if (columnIndex < this.ColumnCount - 1 && this.Rows[rowIndex].Cells[columnIndex + 1].BorderLeft.method_0(version)) { edgeFlags |= (byte)2; virtualEdgeFlags |= (byte)2; } borderBottomFlags = this.method_12(version, cell.BorderBottom); if (borderBottomFlags != 0) { edgeFlags |= (byte)4; } else if (rowIndex < this.RowCount - 1 && this.Rows[rowIndex + 1].Cells[columnIndex].BorderTop.method_0(version)) { edgeFlags |= (byte)4; virtualEdgeFlags |= (byte)4; } borderLeftFlags = this.method_12(version, cell.BorderLeft); if (borderLeftFlags != 0) { edgeFlags |= (byte)8; } else if (columnIndex > 0 && this.Rows[rowIndex].Cells[columnIndex - 1].BorderRight.method_0(version)) { edgeFlags |= (byte)8; virtualEdgeFlags |= (byte)8; } overrideFlags = borderTopFlags << 6 | borderRightFlags << 7 | borderBottomFlags << 8 | borderLeftFlags << 9; if (cell.CellAlignment.HasValue) { overrideFlags |= 1; } if (cell.IsBackColorEnabled.HasValue) { overrideFlags |= 2; } if (cell.BackColor.HasValue) { overrideFlags |= 4; } if (cell.ContentColor.HasValue) { overrideFlags |= 8; } if (cell.TextStyle != null) { overrideFlags |= 16; } if (!cell.TextHeight.HasValue) { return; } overrideFlags |= 32; }
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; } } }
private void CopyFrom(Class1026 from, CloneContext cloneContext) { this.enum47_0 = from.enum47_0; this.bool_0 = from.bool_0; this.int_0 = from.int_0; this.int_1 = from.int_1; this.double_0 = from.double_0; this.dxfValue_0 = from.dxfValue_0 != null?from.dxfValue_0.Clone(cloneContext) : (DxfValue)null; if (from.BlockOrField != null) { if (cloneContext.SourceModel == cloneContext.TargetModel) { this.BlockOrField = from.BlockOrField; } else { DxfBlock blockOrField = from.BlockOrField as DxfBlock; if (blockOrField != null) { DxfBlock dxfBlock; if (!cloneContext.TargetModel.Blocks.TryGetValue(blockOrField.Name, out dxfBlock)) { if (cloneContext.ReferenceResolutionType == ReferenceResolutionType.CloneMissing) { dxfBlock = (DxfBlock)from.BlockOrField.Clone(cloneContext); if (!cloneContext.CloneExact) { cloneContext.TargetModel.Blocks.Add(dxfBlock); } } else if (cloneContext.ReferenceResolutionType == ReferenceResolutionType.FailOnMissing) { throw new DxfException("Block with name " + blockOrField.Name + " not present in target model."); } this.BlockOrField = (DxfHandledObject)dxfBlock; } } else { DxfField dxfField = (DxfField)from.BlockOrField.Clone(cloneContext); if (!cloneContext.TargetModel.FieldList.Fields.Contains(dxfField)) { cloneContext.TargetModel.FieldList.Fields.Add(dxfField); } this.BlockOrField = (DxfHandledObject)dxfField; } } } this.double_1 = from.double_1; if (from.dxfTableAttributeCollection_0 != null) { foreach (DxfTableAttribute dxfTableAttribute in (List <DxfTableAttribute>)from.dxfTableAttributeCollection_0) { this.Attributes.Add(dxfTableAttribute.Clone(cloneContext)); } } if (from.TextStyle != null) { if (cloneContext.SourceModel == cloneContext.TargetModel) { this.TextStyle = from.TextStyle; } else { DxfTextStyle textStyle; if (cloneContext.TargetModel.TextStyles.TryGetValue(from.TextStyle.Name, out textStyle)) { this.TextStyle = textStyle; } else { if (cloneContext.ReferenceResolutionType != ReferenceResolutionType.CloneMissing) { throw new DxfException("Text style with name " + from.TextStyle.Name + " not present in target model."); } this.TextStyle = (DxfTextStyle)from.TextStyle.Clone(cloneContext); if (!cloneContext.CloneExact) { cloneContext.TargetModel.TextStyles.Add(this.TextStyle); } } } } this.nullable_0 = from.nullable_0; this.nullable_1 = from.nullable_1; this.nullable_2 = from.nullable_2; this.nullable_3 = from.nullable_3; this.nullable_4 = from.nullable_4; this.dxfTableBorderOverrides_0.CopyFrom(from.dxfTableBorderOverrides_0, cloneContext); this.dxfTableBorderOverrides_1.CopyFrom(from.dxfTableBorderOverrides_1, cloneContext); this.dxfTableBorderOverrides_2.CopyFrom(from.dxfTableBorderOverrides_2, cloneContext); this.dxfTableBorderOverrides_3.CopyFrom(from.dxfTableBorderOverrides_3, cloneContext); this.int_2 = from.int_2; }