Ejemplo n.º 1
0
        /// <summary>
        /// Paints graduated to dialog background.
        /// </summary>
        /// <param name="graphics"></param>
        /// <param name="rectangle"></param>
        /// <param name="clipRectangle"></param>
        public static void PaintGraduatedBackground(Graphics graphics, GraduatedBackground background, Rectangle rectangle, Rectangle clipRectangle)
        {
            if (graphics == null)
            {
                throw new ArgumentNullException("graphics");
            }

            Color[] colors = GetGraduatedBackgroundColors(background);
            PaintGraduated(graphics, rectangle, clipRectangle, colors[0], colors[1]);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the colors used for graduated background painting.
        /// </summary>
        /// <returns></returns>
        public static Color[] GetGraduatedBackgroundColors(GraduatedBackground background)
        {
            switch (background)
            {
            case GraduatedBackground.None:
                return(new Color[] { SystemColors.Control, SystemColors.Control });

            case GraduatedBackground.ToDialog:
                return(new Color[] { SystemColors.ControlLightLight, SystemColors.Control });

            default:
                throw new NotSupportedException(string.Format("Cannot handle '{0}'.", background));
            }
        }