private void method_3(IExtendedDataValue value, string testValue) { DxfExtendedData.String @string = value as DxfExtendedData.String; if (@string == null || @string.Value != testValue) { throw new Exception("Invalid format of OLE xData."); } }
private string method_4(IExtendedDataValue value) { DxfExtendedData.String @string = value as DxfExtendedData.String; if (@string == null) { throw new Exception("Invalid format of OLE xData."); } return(@string.Value); }
private int method_1(DxfExtendedData.ValueCollection values) { for (int index = 0; index < values.Count; ++index) { DxfExtendedData.String @string = values[index] as DxfExtendedData.String; if (@string != null && @string.Value == "OLEBEGIN") { return(index); } } return(-1); }
internal override void vmethod_10(DxfModel model) { base.vmethod_10(model); DxfExtendedData extendedData; if (!this.HasExtendedData || !this.ExtendedDataCollection.TryGetValue(this.Model.AppIdAcad, out extendedData)) { return; } TrueTypeFontDescriptor typeFontDescriptor = new TrueTypeFontDescriptor(); bool flag = false; foreach (IExtendedDataValue extendedDataValue in (List <IExtendedDataValue>)extendedData.Values) { DxfExtendedData.String @string = extendedDataValue as DxfExtendedData.String; if (@string != null) { typeFontDescriptor.FontFilename = @string.Value; if (!string.IsNullOrEmpty(typeFontDescriptor.FontFilename)) { flag = true; } } else { DxfExtendedData.Int32 int32 = extendedDataValue as DxfExtendedData.Int32; if (int32 != null) { typeFontDescriptor.Flags = (TrueTypeFontFlags)int32.Value; if (typeFontDescriptor.Flags != TrueTypeFontFlags.None) { flag = true; } } } } if (!flag) { return; } this.trueTypeFontDescriptor_0 = typeFontDescriptor; }
private static DxfHandledObject smethod_2( Class374 modelBuilder, IExtendedDataValue value) { DxfExtendedData.DatabaseHandle databaseHandle = value as DxfExtendedData.DatabaseHandle; DxfHandledObject dxfHandledObject = (DxfHandledObject)null; if (databaseHandle != null) { dxfHandledObject = databaseHandle.Value; } else { DxfExtendedData.String @string = value as DxfExtendedData.String; ulong handle = @string == null ? 0UL : DxfHandledObject.Parse(@string.Value); if (handle != 0UL) { dxfHandledObject = modelBuilder.method_3(handle); } } return(dxfHandledObject); }
public static void smethod_0( DxfDimensionStyleOverrides dimensionStyle, DxfExtendedData extendedData, Class374 modelBuilder) { DxfExtendedData.ValueCollection valueCollection = (DxfExtendedData.ValueCollection)null; for (int index1 = 0; index1 < extendedData.Values.Count; ++index1) { DxfExtendedData.String @string = extendedData.Values[index1] as DxfExtendedData.String; if (@string != null && @string.Value == "DSTYLE") { int index2 = index1 + 1; if (index2 < extendedData.Values.Count) { valueCollection = extendedData.Values[index2] as DxfExtendedData.ValueCollection; break; } break; } } if (valueCollection == null) { return; } for (int index1 = 0; index1 < valueCollection.Count; index1 += 2) { DxfExtendedData.Int16 int16 = valueCollection[index1] as DxfExtendedData.Int16; if (int16 != null) { short num = int16.Value; int index2 = index1 + 1; if (index2 < valueCollection.Count) { IExtendedDataValue extendedDataValue = valueCollection[index2]; switch (num) { case 3: dimensionStyle.PostFix = ((DxfExtendedData.String)extendedDataValue).Value; continue; case 4: dimensionStyle.AlternateDimensioningSuffix = ((DxfExtendedData.String)extendedDataValue).Value; continue; case 5: string blockName1 = ((DxfExtendedData.String)extendedDataValue).Value; if (!string.IsNullOrEmpty(blockName1)) { dimensionStyle.ArrowBlock = Class309.smethod_1(modelBuilder, blockName1); continue; } continue; case 6: string blockName2 = ((DxfExtendedData.String)extendedDataValue).Value; if (!string.IsNullOrEmpty(blockName2)) { dimensionStyle.FirstArrowBlock = Class309.smethod_1(modelBuilder, blockName2); continue; } continue; case 7: string blockName3 = ((DxfExtendedData.String)extendedDataValue).Value; if (!string.IsNullOrEmpty(blockName3)) { dimensionStyle.SecondArrowBlock = Class309.smethod_1(modelBuilder, blockName3); continue; } continue; case 40: dimensionStyle.ScaleFactor = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 41: dimensionStyle.ArrowSize = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 42: dimensionStyle.ExtensionLineOffset = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 43: dimensionStyle.DimensionLineIncrement = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 44: dimensionStyle.ExtensionLineExtension = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 45: dimensionStyle.Rounding = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 46: dimensionStyle.DimensionLineExtension = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 47: dimensionStyle.PlusTolerance = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 48: dimensionStyle.MinusTolerance = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 49: dimensionStyle.FixedExtensionLineLength = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 50: dimensionStyle.JoggedRadiusDimensionTransverseSegmentAngle = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 69: dimensionStyle.TextBackgroundFillMode = (DimensionTextBackgroundFillMode)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 70: dimensionStyle.TextBackgroundColor = Color.CreateFromColorIndex(((DxfExtendedData.Int16)extendedDataValue).Value); continue; case 71: dimensionStyle.GenerateTolerances = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 72: dimensionStyle.LimitsGeneration = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 73: dimensionStyle.TextInsideHorizontal = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 74: dimensionStyle.TextOutsideHorizontal = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 75: dimensionStyle.SuppressFirstExtensionLine = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 76: dimensionStyle.SuppressSecondExtensionLine = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 77: dimensionStyle.TextVerticalAlignment = (DimensionTextVerticalAlignment)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 78: dimensionStyle.ZeroHandling = (ZeroHandling)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 79: dimensionStyle.AngularZeroHandling = (ZeroHandling)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 90: dimensionStyle.ArcLengthSymbolPosition = (ArcLengthSymbolPosition)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 140: dimensionStyle.TextHeight = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 141: dimensionStyle.CenterMarkSize = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 142: dimensionStyle.TickSize = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 143: dimensionStyle.AlternateUnitScaleFactor = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 144: dimensionStyle.LinearScaleFactor = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 145: dimensionStyle.TextVerticalPosition = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 146: dimensionStyle.ToleranceScaleFactor = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 147: dimensionStyle.DimensionLineGap = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 148: dimensionStyle.AlternateUnitRounding = ((DxfExtendedData.Double)extendedDataValue).Value; continue; case 170: dimensionStyle.AlternateUnitDimensioning = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 171: dimensionStyle.AlternateUnitDecimalPlaces = ((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 172: dimensionStyle.TextOutsideExtensions = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 173: dimensionStyle.SeparateArrowBlocks = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 174: dimensionStyle.TextInsideExtensions = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 175: dimensionStyle.SuppressOutsideExtensions = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 176: short colorIndex1 = ((DxfExtendedData.Int16)extendedDataValue).Value; dimensionStyle.DimensionLineColor = Color.CreateFromColorIndex(colorIndex1); continue; case 177: short colorIndex2 = ((DxfExtendedData.Int16)extendedDataValue).Value; dimensionStyle.ExtensionLineColor = Color.CreateFromColorIndex(colorIndex2); continue; case 178: short colorIndex3 = ((DxfExtendedData.Int16)extendedDataValue).Value; dimensionStyle.TextColor = Color.CreateFromColorIndex(colorIndex3); continue; case 179: dimensionStyle.AngularDimensionDecimalPlaces = ((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 271: dimensionStyle.DecimalPlaces = Convert.ToInt16(extendedDataValue.ValueObject); continue; case 272: dimensionStyle.ToleranceDecimalPlaces = ((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 273: dimensionStyle.AlternateUnitFormat = (AlternateUnitFormat)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 274: dimensionStyle.AlternateUnitToleranceDecimalPlaces = ((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 275: dimensionStyle.AngularUnit = (AngularUnit)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 276: dimensionStyle.FractionFormat = (FractionFormat)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 277: dimensionStyle.LinearUnitFormat = (LinearUnitFormat)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 278: dimensionStyle.DecimalSeparator = (char)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 279: dimensionStyle.TextMovement = (TextMovement)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 280: dimensionStyle.TextHorizontalAlignment = (DimensionTextHorizontalAlignment)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 281: dimensionStyle.SuppressFirstDimensionLine = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 282: dimensionStyle.SuppressSecondDimensionLine = ((DxfExtendedData.Int16)extendedDataValue).Value == (short)1; continue; case 283: dimensionStyle.ToleranceAlignment = (ToleranceAlignment)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 284: dimensionStyle.ToleranceZeroHandling = (ZeroHandling)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 285: dimensionStyle.AlternateUnitZeroHandling = (ZeroHandling)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 286: dimensionStyle.AlternateUnitToleranceZeroHandling = (ZeroHandling)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 288: dimensionStyle.CursorUpdate = (CursorUpdate)((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 290: dimensionStyle.IsExtensionLineLengthFixed = ((DxfExtendedData.Int16)extendedDataValue).Value != (short)0; continue; case 340: DxfTextStyle dxfTextStyle = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfTextStyle; if (dxfTextStyle != null) { dimensionStyle.TextStyle = dxfTextStyle; continue; } continue; case 341: DxfBlock dxfBlock1 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfBlock; if (dxfBlock1 != null) { dimensionStyle.LeaderArrowBlock = dxfBlock1; continue; } continue; case 342: DxfBlock dxfBlock2 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfBlock; if (dxfBlock2 != null) { dimensionStyle.ArrowBlock = dxfBlock2; continue; } continue; case 343: DxfBlock dxfBlock3 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfBlock; if (dxfBlock3 != null) { dimensionStyle.FirstArrowBlock = dxfBlock3; continue; } continue; case 344: DxfBlock dxfBlock4 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfBlock; if (dxfBlock4 != null) { dimensionStyle.SecondArrowBlock = dxfBlock4; continue; } continue; case 345: DxfLineType dxfLineType1 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfLineType; if (dxfLineType1 != null) { dimensionStyle.DimensionLineLineType = dxfLineType1; continue; } continue; case 346: DxfLineType dxfLineType2 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfLineType; if (dxfLineType2 != null) { dimensionStyle.FirstExtensionLineLineType = dxfLineType2; continue; } continue; case 347: DxfLineType dxfLineType3 = Class309.smethod_2(modelBuilder, extendedDataValue) as DxfLineType; if (dxfLineType3 != null) { dimensionStyle.SecondExtensionLineLineType = dxfLineType3; continue; } continue; case 371: dimensionStyle.DimensionLineWeight = ((DxfExtendedData.Int16)extendedDataValue).Value; continue; case 372: dimensionStyle.ExtensionLineWeight = ((DxfExtendedData.Int16)extendedDataValue).Value; continue; default: continue; } } } else { modelBuilder.Messages.Add(new DxfMessage(DxfStatus.InvalidXDataValueType, Severity.Warning, "ValueType", (object)valueCollection[index1].GetType()) { Parameters = { { "ExpectedValueType", (object)typeof(DxfExtendedData.Int16) }, { "Target", (object)dimensionStyle } } }); break; } } }
internal void method_18(DxfModel model) { DxfExtendedData extendedData; if (!this.ExtendedDataCollection.TryGetValue(model.AppIdAcad, out extendedData) || extendedData.Values.Count != 2) { return; } DxfExtendedData.ValueCollection valueCollection = (DxfExtendedData.ValueCollection)extendedData.Values[1]; if (valueCollection.Count != 27) { return; } this.point3D_1 = ((DxfExtendedData.PointOrVector)valueCollection[1]).GetPoint3D(); this.vector3D_0 = ((DxfExtendedData.PointOrVector)valueCollection[2]).GetVector3D(); this.double_6 = ((DxfExtendedData.Double)valueCollection[3]).Value; this.double_4 = ((DxfExtendedData.Double)valueCollection[4]).Value; this.point2D_0.X = ((DxfExtendedData.Double)valueCollection[5]).Value; this.point2D_0.Y = ((DxfExtendedData.Double)valueCollection[6]).Value; this.double_1 = ((DxfExtendedData.Double)valueCollection[7]).Value; this.double_2 = ((DxfExtendedData.Double)valueCollection[8]).Value; this.double_3 = ((DxfExtendedData.Double)valueCollection[9]).Value; this.StatusFlags |= (ViewportStatusFlags)((DxfExtendedData.Int16)valueCollection[10]).Value; this.double_7 = (double)((DxfExtendedData.Int16)valueCollection[11]).Value; if (((DxfExtendedData.Int16)valueCollection[12]).Value == (short)1) { this.StatusFlags |= ViewportStatusFlags.FastZoom; } this.bool_3 = ((DxfExtendedData.Int16)valueCollection[13]).Value == (short)1; if (((DxfExtendedData.Int16)valueCollection[14]).Value == (short)1) { this.StatusFlags |= ViewportStatusFlags.SnapMode; } if (((DxfExtendedData.Int16)valueCollection[15]).Value == (short)1) { this.StatusFlags |= ViewportStatusFlags.GridMode; } if (((DxfExtendedData.Int16)valueCollection[16]).Value == (short)1) { this.StatusFlags |= ViewportStatusFlags.IsometricSnapStyle; } short num = ((DxfExtendedData.Int16)valueCollection[17]).Value; if (((int)num & 1) != 0) { this.StatusFlags |= ViewportStatusFlags.KIsoPairTop; } if (((int)num & 2) != 0) { this.StatusFlags |= ViewportStatusFlags.KIsoPairRight; } this.double_5 = ((DxfExtendedData.Double)valueCollection[18]).Value; this.point2D_1.X = ((DxfExtendedData.Double)valueCollection[19]).Value; this.point2D_1.Y = ((DxfExtendedData.Double)valueCollection[20]).Value; this.vector2D_0.X = ((DxfExtendedData.Double)valueCollection[21]).Value; this.vector2D_0.Y = ((DxfExtendedData.Double)valueCollection[22]).Value; this.vector2D_1.X = ((DxfExtendedData.Double)valueCollection[23]).Value; this.vector2D_1.Y = ((DxfExtendedData.Double)valueCollection[24]).Value; if (((DxfExtendedData.Int16)valueCollection[25]).Value == (short)1) { this.StatusFlags |= ViewportStatusFlags.HidePlot; } foreach (IExtendedDataValue extendedDataValue in (List <IExtendedDataValue>)valueCollection[26]) { DxfExtendedData.LayerReference layerReference = extendedDataValue as DxfExtendedData.LayerReference; if (layerReference != null) { this.dxfHandledObjectCollection_1.Add(layerReference.Value); } else { DxfExtendedData.String @string = extendedDataValue as DxfExtendedData.String; if (@string == null) { throw new DxfException("Illegal frozen layer value. Expected layer reference or layer reference name string."); } this.dxfHandledObjectCollection_1.Add(model.Layers[@string.Value]); } } }