예제 #1
0
        protected void Draw(PaintArgs p, Rectangle r, BorderStyleControl style, int thickness, Color color)
        {
            switch (style)
            {
            case BorderStyleControl.None:
                return;

            case BorderStyleControl.RoundedSides:
                BorderSpecial.DrawRoundedSides(p, r, BevelStyle.Raised, thickness, color);
                return;

            case BorderStyleControl.Raised:
                if (thickness <= 2)
                {
                    break;
                }
                BorderSpecial.DrawRectangle(p, r, BevelStyle.Raised, thickness, color);
                return;
            }
            if (style == BorderStyleControl.Sunken && thickness > 2)
            {
                BorderSpecial.DrawRectangle(p, r, BevelStyle.Sunken, thickness, color);
            }
            else
            {
                switch (style)
                {
                case BorderStyleControl.Raised:
                    BorderSimple.Draw(p, r, BorderStyleSimple.Raised, color);
                    break;

                case BorderStyleControl.Sunken:
                    BorderSimple.Draw(p, r, BorderStyleSimple.Sunken, color);
                    break;

                case BorderStyleControl.Bump:
                    BorderSimple.Draw(p, r, BorderStyleSimple.Bump, color);
                    break;

                case BorderStyleControl.Etched:
                    BorderSimple.Draw(p, r, BorderStyleSimple.Etched, color);
                    break;

                case BorderStyleControl.Flat:
                    BorderSimple.Draw(p, r, BorderStyleSimple.Flat, color);
                    break;

                case BorderStyleControl.RaisedInner:
                    BorderSimple.Draw(p, r, BorderStyleSimple.RaisedInner, color);
                    break;

                case BorderStyleControl.RaisedOuter:
                    BorderSimple.Draw(p, r, BorderStyleSimple.RaisedOuter, color);
                    break;

                case BorderStyleControl.SunkenInner:
                    BorderSimple.Draw(p, r, BorderStyleSimple.SunkenInner, color);
                    break;

                case BorderStyleControl.SunkenOuter:
                    BorderSimple.Draw(p, r, BorderStyleSimple.SunkenOuter, color);
                    break;
                }
            }
        }
예제 #2
0
 void IBorderControl.Draw(PaintArgs p, Rectangle r, BorderStyleControl style, int thicknessDesired, Color color)
 {
     this.Draw(p, r, style, thicknessDesired, color);
 }