Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
                }
            }
Esempio n. 4
0
 public void Start(IWindowsFormsEditorService service, object val)
 {
     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();
     }
 }
Esempio n. 5
0
 private void ResetLeftPair()
 {
     leftPair = new ColorPair(Color.Orange, Color.White, 270);
 }
Esempio n. 6
0
        protected virtual bool ShouldSerializeLeftPair()
        {
            ColorPair pa = new ColorPair(Color.Orange, Color.White, 270);

            return(leftPair != pa);
        }
Esempio n. 7
0
 protected virtual void ResetHeaderPair()
 {
     headerPair = new ColorPair();
 }
 public void ResetPair()
 {
     pair = new ColorPair();
 }
 protected virtual void ResetHeaderPair()
 {
     headerPair = new ColorPair();
 }
Esempio n. 10
0
 private void ResetLeftPair()
 {
     leftPair = new ColorPair(Color.Orange, Color.White, 270);
 }
Esempio n. 11
0
 protected virtual bool ShouldSerializeLeftPair()
 {
     ColorPair pa = new ColorPair(Color.Orange, Color.White, 270);
     return leftPair != pa;
 }
Esempio n. 12
0
 public void End()
 {
     edSvc = null;
     value = null;
 }
Esempio n. 13
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();
     }
 }
Esempio n. 14
0
 public void End()
 {
     edSvc = null;
     value = null;
 }
Esempio n. 15
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;
 }
Esempio n. 16
0
 public void ResetPair()
 {
     pair = new ColorPair();
 }