示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 public BrushDialog(BrushData brushData)
 {
     InitializeComponent();
     UserControl1.brushData     = (BrushData)brushData.Clone();
     UserControl1.BrushChanged += BrushDataChanged;
 }