public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { try { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc != null) { if (value is Color) { Color result = Color.Black; ColorDialog loColorForm = new ColorDialog(); DialogResult dr = loColorForm.ShowDialog(); if (dr == DialogResult.OK) { System.Drawing.Color loResultColor = loColorForm.Color; result = loResultColor; } return(result); } } } catch (Exception ex) { LogSys.Popup("Exception", "PropertyGridDateItem Error : " + ex.Message); return(value); } return(value); }
public void ContentChange(int w, int h) { try { if (null != _canvas) { _canvas.Dispose(); } _canvas = new BitmapCanvas(w, h, PixelFormat.Format32bppArgb); } catch (Exception e) { LogSys.Popup("Exception", e.Message); } }