Exemplo n.º 1
0
        ///<summary>
        ///Creates a new object that is a copy of the current instance.
        ///</summary>
        ///
        ///<returns>
        ///A new object that is a copy of this instance.
        ///</returns>
        ///<filterpriority>2</filterpriority>
        public object Clone()
        {
            ColorPair pair = new ColorPair();

            pair.backColor1 = backColor1;
            pair.backColor2 = backColor2;
            pair.gradient   = gradient;
            return(pair);
        }
Exemplo n.º 2
0
        ///<summary>
        ///Determines whether the specified <see cref="T:System.Object"></see> is equal to the current <see cref="T:System.Object"></see>.
        ///</summary>
        ///
        ///<returns>
        ///true if the specified <see cref="T:System.Object"></see> is equal to the current <see cref="T:System.Object"></see>; otherwise, false.
        ///</returns>
        ///
        ///<param name="obj">The <see cref="T:System.Object"></see> to compare with the current <see cref="T:System.Object"></see>. </param><filterpriority>2</filterpriority>
        public override bool Equals(object obj)
        {
            ColorPair pair = obj as ColorPair;

            if (pair != null)
            {
                return(pair.BackColor1.Equals(backColor1) && pair.BackColor2.Equals(backColor2) && pair.Gradient.Equals(gradient));
            }
            return(false);
        }
Exemplo n.º 3
0
            ///<summary>
            ///Paints a representation of the value of an object using the specified <see cref="T:System.Drawing.Design.PaintValueEventArgs"></see>.
            ///</summary>
            ///
            ///<param name="e">A <see cref="T:System.Drawing.Design.PaintValueEventArgs"></see> that indicates what to paint and where to paint it. </param>
            public override void PaintValue(PaintValueEventArgs e)
            {
                base.PaintValue(e);
                ColorPair pair = e.Value as ColorPair;

                if (pair != null)
                {
                    LinearGradientBrush br = new LinearGradientBrush(e.Bounds, pair.BackColor1, pair.BackColor2, pair.Gradient);
                    e.Graphics.FillRectangle(br, e.Bounds);
                }
            }
Exemplo n.º 4
0
 public void Start(IWindowsFormsEditorService service, object val)
 {
     this.edSvc = service;
     value      = val as ColorPair;
     if (val != null)
     {
         pnlOldBack1.BackColor = value.BackColor1;
         pnlOldBack2.BackColor = value.BackColor2;
         pnlNewBack1.BackColor = value.BackColor1;
         pnlNewBack2.BackColor = value.BackColor2;
         lblOldGrad.Text       = value.Gradient.ToString();
         gradUI.Value          = value.Gradient;
         pnlPreview.Refresh();
     }
 }
Exemplo n.º 5
0
 protected virtual void ResetHeaderPair()
 {
     headerPair = new ColorPair();
 }
Exemplo n.º 6
0
 public void ResetPair()
 {
     pair = new ColorPair();
 }
Exemplo n.º 7
0
 public void End()
 {
     edSvc = null;
     value = null;
 }
Exemplo n.º 8
0
 private void ResetLeftPair()
 {
     leftPair = new ColorPair(Color.Orange, Color.White, 270);
 }
Exemplo n.º 9
0
        protected virtual bool ShouldSerializeLeftPair()
        {
            ColorPair pa = new ColorPair(Color.Orange, Color.White, 270);

            return(leftPair != pa);
        }