Ejemplo n.º 1
0
 public void SetBrush(IBrushData value)
 {
     this.rbSolid.Tag = (value is SolidBrushData) ? value : new SolidBrushData();
     this.rbHatch.Tag = (value is HatchBrushData) ? value : new HatchBrushData();
     this.rbGradient.Tag = (value is LinearGradientBrushData) ? value : new LinearGradientBrushData();
     this.TurnOnRadioButton(value);
 }
Ejemplo n.º 2
0
 public void SetBrush(IBrushData value)
 {
     this.rbSolid.Tag    = (value is SolidBrushData) ? value : new SolidBrushData();
     this.rbHatch.Tag    = (value is HatchBrushData) ? value : new HatchBrushData();
     this.rbGradient.Tag = (value is LinearGradientBrushData) ? value : new LinearGradientBrushData();
     this.TurnOnRadioButton(value);
 }
Ejemplo n.º 3
0
        public void SetPenData(PenData value)
        {
            IBrushData bd = (value == null) ? null : value.Brush;

            this.rbSolid.Tag    = (bd is SolidBrushData) ? value : new PenData(new SolidBrushData());
            this.rbGradient.Tag = (bd is LinearGradientBrushData) ? value : new PenData(new LinearGradientBrushData());
            this.rbHatch.Tag    = (bd is HatchBrushData) ? value : new PenData(new HatchBrushData());
            this.TurnOnRadioButton(bd);
        }
Ejemplo n.º 4
0
        public Brush GetBrush()
        {
            IBrushData bd = this.GetBrushData();

            if (bd == null)
            {
                return(null);
            }
            else
            {
                return(bd.GetBrush());
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Draw a representation of our value
        /// </summary>
        public override void PaintValue(PaintValueEventArgs e)
        {
            IBrushData bd = e.Value as IBrushData;

            if (bd == null)
            {
                base.PaintValue(e);
            }
            else
            {
                e.Graphics.FillRectangle(BlockFormat.PrepareBrushForDrawing(bd.GetBrush(), e.Bounds), e.Bounds);
            }
        }
Ejemplo n.º 6
0
        protected void TurnOnRadioButton(IBrushData value)
        {
            RadioButton turnedOn = this.rbNone;
            if (value != null) {
                if (value.GetType() == typeof(SolidBrushData))
                    turnedOn = this.rbSolid;
                else if (value.GetType() == typeof(LinearGradientBrushData))
                    turnedOn = this.rbGradient;
                else if (value.GetType() == typeof(HatchBrushData))
                    turnedOn = this.rbHatch;
            }

            turnedOn.Checked = true;
        }
Ejemplo n.º 7
0
        public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
        {
            IBrushData b = value as IBrushData;

            if (destinationType == typeof(string))
            {
                if (b == null)
                {
                    return("(none)");
                }
                else
                {
                    return(b.GetType().Name);
                }
            }

            return(base.ConvertTo(context, culture, value, destinationType));
        }
Ejemplo n.º 8
0
        protected void TurnOnRadioButton(IBrushData value)
        {
            RadioButton turnedOn = this.rbNone;

            if (value != null)
            {
                if (value.GetType() == typeof(SolidBrushData))
                {
                    turnedOn = this.rbSolid;
                }
                else if (value.GetType() == typeof(LinearGradientBrushData))
                {
                    turnedOn = this.rbGradient;
                }
                else if (value.GetType() == typeof(HatchBrushData))
                {
                    turnedOn = this.rbHatch;
                }
            }

            turnedOn.Checked = true;
        }
Ejemplo n.º 9
0
 public PenData(IBrushData brush)
 {
     this.Brush = brush;
 }
Ejemplo n.º 10
0
 public PenData(IBrushData brush)
 {
     this.Brush = brush;
 }