Esempio n. 1
0
        private void UpdateAllExcept(string exceptWhat)
        {
            if (exceptWhat == null)
            {
                exceptWhat = "";
            }

            //Color clr = this.colorPickerPainter1.Color;
            ColorBase clr = this.colorPickerPainter1.ColorObject;

            clr.Validate();
            this.colorChip1.ColorObject = clr;

            if (exceptWhat.IndexOf("Alpha") < 0)
            {
                this.numAlpha.Value = clr.A;
            }

            if (exceptWhat.IndexOf("RGB") < 0)
            {
                //if (clr is ColorRgb)
                //    this.colorNumericRGB.ColorObject = clr;
                //else
                this.colorNumericRGB.ColorObject = new ColorRgb(clr.RgbFloat);
            }
            if (exceptWhat.IndexOf("HSB") < 0)
            {
                if (clr is ColorHsb)
                {
                    this.colorNumericHSB.ColorObject = clr;
                }
                else
                {
                    this.colorNumericHSB.ColorObject = new ColorHsb(clr.RgbFloat);
                }
            }
            if (exceptWhat.IndexOf("Multi") < 0 && this.colorPickerMultiEx1 != null)
            {
                this.colorPickerMultiEx1.ColorObject = clr;
            }

            if (exceptWhat.IndexOf("ColorTextBox") < 0)
            {
                this.updateFromTextBox = false;
                Endogine.ColorEx.ColorRgb rgb = new Endogine.ColorEx.ColorRgb(clr.ColorRGBA);
                this.tbColorText.Text  = rgb.ToString("X");
                this.updateFromTextBox = true;
            }

            if (exceptWhat.IndexOf("Event") < 0)
            {
                if (this.ColorChanged != null)
                {
                    this.ColorChanged(this, null);
                }
            }
        }
Esempio n. 2
0
 private void SetFromColorTextBox()
 {
     try
     {
         Endogine.ColorEx.ColorRgb clr = new Endogine.ColorEx.ColorRgb(this.tbColorText.Text);
         this.colorPickerPainter1.ColorObject = clr;
         this.UpdateAllExcept("ColorTextBox");
     }
     catch
     {
     }
 }
Esempio n. 3
0
        private void UpdateAllExcept(string exceptWhat)
        {
            if (exceptWhat == null)
                exceptWhat = "";

            //Color clr = this.colorPickerPainter1.Color;
            ColorBase clr = this.colorPickerPainter1.ColorObject;
            clr.Validate();
            this.colorChip1.ColorObject = clr;

            if (exceptWhat.IndexOf("Alpha") < 0)
                this.numAlpha.Value = clr.A;

            if (exceptWhat.IndexOf("RGB") < 0)
            {
                //if (clr is ColorRgb)
                //    this.colorNumericRGB.ColorObject = clr;
                //else
                this.colorNumericRGB.ColorObject = new ColorRgb(clr.RgbFloat);
            }
            if (exceptWhat.IndexOf("HSB") < 0)
            {
                if (clr is ColorHsb)
                    this.colorNumericHSB.ColorObject = clr;
                else
                    this.colorNumericHSB.ColorObject = new ColorHsb(clr.RgbFloat);
            }
            if (exceptWhat.IndexOf("Multi") < 0 && this.colorPickerMultiEx1 != null)
                this.colorPickerMultiEx1.ColorObject = clr;

            if (exceptWhat.IndexOf("ColorTextBox") < 0)
            {
                this.updateFromTextBox = false;
                Endogine.ColorEx.ColorRgb rgb = new Endogine.ColorEx.ColorRgb(clr.ColorRGBA);
                this.tbColorText.Text = rgb.ToString("X");
                this.updateFromTextBox = true;
            }

            if (exceptWhat.IndexOf("Event") < 0)
                if (this.ColorChanged != null)
                    this.ColorChanged(this, null);
        }
Esempio n. 4
0
 private void SetFromColorTextBox()
 {
     try
     {
         Endogine.ColorEx.ColorRgb clr = new Endogine.ColorEx.ColorRgb(this.tbColorText.Text);
         this.colorPickerPainter1.ColorObject = clr;
         this.UpdateAllExcept("ColorTextBox");
     }
     catch
     {
     }
 }