protected void DrawSymbol(int int_3, Rectangle rectangle_0, object object_0) { if (object_0 != null) { if (object_0 is IMapGrid) { tagRECT tagRECT = default(tagRECT); tagRECT.left = rectangle_0.Left; tagRECT.right = rectangle_0.Right; tagRECT.top = rectangle_0.Top; tagRECT.bottom = rectangle_0.Bottom; IMapFrame mapFrame = new MapFrame() as IMapFrame; IMap map = new Map(); mapFrame.Map = map; (object_0 as IMapGrid).PrepareForOutput(int_3, 96, ref tagRECT, mapFrame); } else { IStyleDraw styleDraw = StyleDrawFactory.CreateStyleDraw(object_0); if (styleDraw != null) { styleDraw.Draw(int_3, rectangle_0, 1.0, 1.0); } } } }
private void StyleComboBox_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) { if (this.iarray_0.Count != 0) { e.DrawBackground(); try { IStyleGalleryItem styleGalleryItem = this.iarray_0.get_Element(e.Index) as IStyleGalleryItem; if (styleGalleryItem != null) { System.IntPtr hdc = e.Graphics.GetHdc(); IStyleDraw styleDraw = StyleDrawFactory.CreateStyleDraw(styleGalleryItem.Item); if (styleDraw != null) { e.Bounds.Inflate(-2, -4); styleDraw.Draw(hdc.ToInt32(), e.Bounds, 72.0, 1.0); } e.Graphics.ReleaseHdc(hdc); } else { Brush brush = new SolidBrush(e.ForeColor); e.Graphics.DrawString(base.Items[e.Index].ToString(), e.Font, brush, (float)(e.Bounds.Left + 3), (float)(e.Bounds.Top + 3)); } } catch { } } }
private void NewSymbolButton_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { if (this.object_0 != null) { System.IntPtr hdc = e.Graphics.GetHdc(); IStyleDraw styleDraw = StyleDrawFactory.CreateStyleDraw(this.object_0); if (styleDraw != null) { Rectangle clipRectangle = e.ClipRectangle; clipRectangle.Inflate(-3, -3); styleDraw.Draw(hdc.ToInt32(), clipRectangle, 96.0, 1.0); } e.Graphics.ReleaseHdc(hdc); } }
public void Add(IStyleGalleryItem istyleGalleryItem_0) { IStyleDraw styleDraw = StyleDrawFactory.CreateStyleDraw(istyleGalleryItem_0.Item); if (styleDraw != null) { string[] items = new string[] { istyleGalleryItem_0.Name, istyleGalleryItem_0.Category }; Bitmap image = styleDraw.StyleGalleryItemToBmp(this.imageList_3.ImageSize, 96.0, 1.0); Bitmap image2 = styleDraw.StyleGalleryItemToBmp(this.imageList_2.ImageSize, 96.0, 1.0); int count = this.imageList_3.Images.Count; this.imageList_3.Images.Add(count.ToString(), image); this.imageList_2.Images.Add(count.ToString(), image2); System.Windows.Forms.ListViewItem listViewItem = new System.Windows.Forms.ListViewItem(items, count.ToString()); listViewItem.Tag = istyleGalleryItem_0; base.Items.Add(listViewItem); } }
public void UpdateItem(System.Windows.Forms.ListViewItem listViewItem_1) { if (listViewItem_1 != null) { if (listViewItem_1.Tag is IStyleGalleryItem) { string imageKey = listViewItem_1.ImageKey; IStyleDraw styleDraw = StyleDrawFactory.CreateStyleDraw((listViewItem_1.Tag as IStyleGalleryItem).Item); if (styleDraw != null) { Bitmap image = styleDraw.StyleGalleryItemToBmp(this.imageList_3.ImageSize, 96.0, 1.0); Bitmap image2 = styleDraw.StyleGalleryItemToBmp(this.imageList_2.ImageSize, 96.0, 1.0); int arg_A3_0 = this.imageList_3.Images.Count; this.imageList_3.Images.RemoveByKey(imageKey); this.imageList_3.Images.Add(imageKey, image); this.imageList_2.Images.RemoveByKey(imageKey); this.imageList_2.Images.Add(imageKey, image2); } } else if (listViewItem_1.Tag is SymbolListViewEx.ItemData) { string imageKey = listViewItem_1.ImageKey; IStyleDraw styleDraw = StyleDrawFactory.CreateStyleDraw( (listViewItem_1.Tag as SymbolListViewEx.ItemData).StyleGalleryItem.Item); if (styleDraw != null) { Bitmap image = styleDraw.StyleGalleryItemToBmp(this.imageList_3.ImageSize, 96.0, 1.0); Bitmap image2 = styleDraw.StyleGalleryItemToBmp(this.imageList_2.ImageSize, 96.0, 1.0); int arg_18B_0 = this.imageList_3.Images.Count; this.imageList_3.Images.RemoveByKey(imageKey); this.imageList_3.Images.Add(imageKey, image); this.imageList_2.Images.RemoveByKey(imageKey); this.imageList_2.Images.Add(imageKey, image2); } } } }