public object Clone() { BrushData other = new BrushData(); other.BrushType = this.BrushType; other.SolidBrushInfo = this.SolidBrushInfo.Clone(); other.LinearGradientBrushInfo = this.LinearGradientBrushInfo.Clone(); other.TextrueBrushInfo = this.TextrueBrushInfo.Clone(); other.HatchBrushInfo = this.HatchBrushInfo.Clone(); other.PathGradientBrushInfo = this.PathGradientBrushInfo.Clone(); return(other); }
public override object EditValue(ITypeDescriptorContext context, System. IServiceProvider provider, object value) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc != null) { BrushData bd = (value as ICloneable).Clone() as BrushData; BrushDialog dlg = new BrushDialog(bd); if (dlg.ShowDialog() == DialogResult.OK) { value = dlg.BrushData; } } return(value); }
public BrushDialog(BrushData brushData) { InitializeComponent(); UserControl1.brushData = (BrushData)brushData.Clone(); UserControl1.BrushChanged += BrushDataChanged; }