internal static DxfLineType smethod_4(bool useFixedHandles) { DxfLineType dxfLineType = new DxfLineType("ByLayer", "", false, (double[])null); if (useFixedHandles) { dxfLineType.SetHandle(21UL); } return(dxfLineType); }
internal static DxfLineType smethod_2(bool useFixedHandles) { DxfLineType dxfLineType = new DxfLineType("Continuous", "Solid line", false, (double[])null); if (useFixedHandles) { dxfLineType.SetHandle(22UL); } return(dxfLineType); }
public override IGraphCloneable Clone(CloneContext cloneContext) { DxfLineType dxfLineType = (DxfLineType)cloneContext.GetExistingClone((IGraphCloneable)this); if (dxfLineType == null) { dxfLineType = new DxfLineType(); cloneContext.RegisterClone((IGraphCloneable)this, (IGraphCloneable)dxfLineType); dxfLineType.CopyFrom((DxfHandledObject)this, cloneContext); } return((IGraphCloneable)dxfLineType); }
public override object EditValue( ITypeDescriptorContext context, System.IServiceProvider provider, object value) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type DxfLineType.WinFormsPicker.Class468 class468 = new DxfLineType.WinFormsPicker.Class468(); // ISSUE: reference to a compiler-generated field class468.iwindowsFormsEditorService_0 = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); // ISSUE: reference to a compiler-generated field if (class468.iwindowsFormsEditorService_0 == null) { return((object)null); } DxfLineType dxfLineType = value as DxfLineType; if (dxfLineType == null) { return((object)null); } ListBox listBox = new ListBox(); // ISSUE: reference to a compiler-generated method listBox.SelectedIndexChanged += new EventHandler(class468.method_0); listBox.DrawMode = DrawMode.OwnerDrawFixed; listBox.DrawItem += new DrawItemEventHandler(this.method_0); DxfModel model = dxfLineType.Model; foreach (DxfLineType lineType in (KeyedDxfHandledObjectCollection <string, DxfLineType>)model.LineTypes) { listBox.Items.Add((object)lineType); } listBox.Size = new Size(400, 200); // ISSUE: reference to a compiler-generated field class468.iwindowsFormsEditorService_0.DropDownControl((Control)listBox); if (listBox.SelectedItems != null && listBox.SelectedItems.Count > 0) { return(listBox.SelectedItems[0]); } return((object)model.ContinuousLineType); }
private void method_0(object sender, DrawItemEventArgs e) { DxfLineType dxfLineType = (DxfLineType)((ListBox)sender).Items[e.Index]; e.DrawBackground(); int x1 = e.Bounds.Left + 1; int top = e.Bounds.Top; int num1 = 100; int height = e.Bounds.Height; int num2 = (e.Bounds.Top + e.Bounds.Bottom) / 2; if (dxfLineType.Elements.Count == 0) { e.Graphics.DrawLine(Pens.Black, x1, num2, x1 + num1, num2); } else { int num3 = 3; double num4 = (double)num1 / (3.0 * dxfLineType.TotalLength); double num5 = 0.0; for (int index = 0; index < num3; ++index) { foreach (DxfLineType.Element element in (List <DxfLineType.Element>)dxfLineType.Elements) { double num6 = num5 + System.Math.Abs(element.Length); if (element.Length == 0.0) { Class735.smethod_3(e.Graphics, System.Drawing.Color.Black, x1 + (int)(num4 * num5), num2); } else if (element.Length > 0.0) { e.Graphics.DrawLine(Pens.Black, x1 + (int)(num4 * num5), num2, x1 + (int)(num4 * num6), num2); } num5 = num6; } } } e.Graphics.DrawString(dxfLineType.ToString(), SystemFonts.DefaultFont, SystemBrushes.ControlText, new RectangleF((float)(x1 + num1 + 3), (float)e.Bounds.Top, (float)(e.Bounds.Right - (x1 + num1) - 3), (float)e.Bounds.Height)); e.DrawFocusRectangle(); }
public override void CopyFrom(DxfHandledObject from, CloneContext cloneContext) { base.CopyFrom(from, cloneContext); DxfLineType dxfLineType = (DxfLineType)from; this.string_0 = dxfLineType.string_0; this.string_1 = dxfLineType.string_1; this.bool_0 = dxfLineType.bool_0; this.standardFlags_0 = dxfLineType.standardFlags_0; this.elementCollection_0.Clear(); foreach (DxfLineType.Element element in (List <DxfLineType.Element>)dxfLineType.elementCollection_0) { this.elementCollection_0.Add(element.Clone(cloneContext)); } switch (dxfLineType.Handle) { case 20: case 21: case 22: this.SetHandle(dxfLineType.Handle); break; } }
public void SetLineTypeOverride(DxfViewport viewport, DxfLineType lineTypeOverride) { if (viewport == null) { return; } if (lineTypeOverride != null) { this.ViewportLayerOverridesNotNull.ViewportLineTypeOverridesNotNull[viewport] = lineTypeOverride; } else { if (this.class905_0 == null || this.class905_0.dictionary_1 == null || !this.class905_0.dictionary_1.ContainsKey(viewport)) { return; } this.class905_0.dictionary_1.Remove(viewport); if (this.class905_0.dictionary_1.Count == 0) { this.class905_0.dictionary_1 = (Dictionary <DxfViewport, DxfLineType>)null; } this.method_11(); } }
internal override void vmethod_10(DxfModel model) { base.vmethod_10(model); DxfExtendedData extendedData; if (this.HasExtendedData && this.ExtendedDataCollection.TryGetValue(this.Model, "AcCmTransparency", out extendedData)) { IEnumerator <IExtendedDataValue> enumerator = (IEnumerator <IExtendedDataValue>) new DxfExtendedData.RecursiveEnumerator((IEnumerator <IExtendedDataValue>)extendedData.Values.GetEnumerator()); while (enumerator.MoveNext()) { DxfExtendedData.Int32 current = enumerator.Current as DxfExtendedData.Int32; if (current != null) { this.transparency_0 = new Transparency((uint)current.Value); if (this.transparency_0.TransparencyType != TransparencyType.ByValue) { this.transparency_0 = Transparency.Opaque; break; } break; } } } if (this.ExtensionDictionary == null) { return; } DxfXRecord valueByName1 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_COLOR_OVR") as DxfXRecord; if (valueByName1 != null) { List <DxfXRecordValue> .Enumerator enumerator = valueByName1.Values.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current.Code == (short)102 && enumerator.Current.Value as string == "{ADSK_LYR_COLOR_OVERRIDE") { DxfViewport key = (DxfViewport)null; uint? nullable = new uint?(); while (enumerator.MoveNext() && (enumerator.Current.Code != (short)102 || !(enumerator.Current.Value as string == "}"))) { switch (enumerator.Current.Code) { case 335: key = enumerator.Current.Value as DxfViewport; continue; case 420: nullable = new uint?((uint)Convert.ToInt32(enumerator.Current.Value)); continue; default: continue; } } if (key != null && nullable.HasValue) { this.ViewportLayerOverridesNotNull.ViewportColorOverridesNotNull.Add(key, Color.smethod_0(nullable.Value)); } } } } DxfXRecord valueByName2 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_LINETYPE_OVR") as DxfXRecord; if (valueByName2 != null) { List <DxfXRecordValue> .Enumerator enumerator = valueByName2.Values.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current.Code == (short)102 && enumerator.Current.Value as string == "{ADSK_LYR_LINETYPE_OVERRIDE") { DxfViewport key = (DxfViewport)null; DxfLineType dxfLineType = (DxfLineType)null; while (enumerator.MoveNext() && (enumerator.Current.Code != (short)102 || !(enumerator.Current.Value as string == "}"))) { switch (enumerator.Current.Code) { case 335: key = enumerator.Current.Value as DxfViewport; continue; case 343: dxfLineType = enumerator.Current.Value as DxfLineType; continue; default: continue; } } if (key != null && dxfLineType != null) { this.ViewportLayerOverridesNotNull.ViewportLineTypeOverridesNotNull.Add(key, dxfLineType); } } } } DxfXRecord valueByName3 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_LINEWT_OVR") as DxfXRecord; if (valueByName3 != null) { List <DxfXRecordValue> .Enumerator enumerator = valueByName3.Values.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current.Code == (short)102 && enumerator.Current.Value as string == "{ADSK_LYR_LINEWT_OVERRIDE") { DxfViewport key = (DxfViewport)null; short? nullable = new short?(); while (enumerator.MoveNext() && (enumerator.Current.Code != (short)102 || !(enumerator.Current.Value as string == "}"))) { switch (enumerator.Current.Code) { case 91: nullable = new short?(Convert.ToInt16(enumerator.Current.Value)); continue; case 335: key = enumerator.Current.Value as DxfViewport; continue; default: continue; } } if (key != null && nullable.HasValue) { this.ViewportLayerOverridesNotNull.ViewportLineWeightOverridesNotNull.Add(key, nullable.Value); } } } } DxfXRecord valueByName4 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_ALPHA_OVR") as DxfXRecord; if (valueByName4 == null) { return; } List <DxfXRecordValue> .Enumerator enumerator1 = valueByName4.Values.GetEnumerator(); while (enumerator1.MoveNext()) { if (enumerator1.Current.Code == (short)102 && enumerator1.Current.Value as string == "{ADSK_LYR_ALPHA_OVERRIDE") { DxfViewport key = (DxfViewport)null; uint? nullable = new uint?(); while (enumerator1.MoveNext() && (enumerator1.Current.Code != (short)102 || !(enumerator1.Current.Value as string == "}"))) { switch (enumerator1.Current.Code) { case 335: key = enumerator1.Current.Value as DxfViewport; continue; case 440: nullable = new uint?((uint)Convert.ToInt32(enumerator1.Current.Value)); continue; default: continue; } } if (key != null && nullable.HasValue) { this.ViewportLayerOverridesNotNull.ViewportTransparencyOverridesNotNull.Add(key, new Transparency(nullable.Value)); } } } }