ComponentFactory.Krypton.Toolkit.RenderStandard.CreateTabBorderPath C# (CSharp) Method

CreateTabBorderPath() private static method

private static CreateTabBorderPath ( bool rtl, PaletteState state, bool forBorder, GraphicsPath borderPath, Rectangle rect, TabBorderStyle tabBorderStyle, VisualOrientation orientation ) : void
rtl bool
state PaletteState
forBorder bool
borderPath System.Drawing.Drawing2D.GraphicsPath
rect System.Drawing.Rectangle
tabBorderStyle TabBorderStyle
orientation VisualOrientation
return void
        private static void CreateTabBorderPath(bool rtl,
                                                PaletteState state,
                                                bool forBorder,
                                                GraphicsPath borderPath,
                                                Rectangle rect,
                                                TabBorderStyle tabBorderStyle,
                                                VisualOrientation orientation)
        {
            // Correct drawing by reducing drawing rectangle
            switch (orientation)
            {
                case VisualOrientation.Top:
                    rect.Width--;
                    break;
                case VisualOrientation.Bottom:
                    rect.Y--;
                    rect.Width--;
                    break;
                case VisualOrientation.Left:
                    rect.Height--;
                    break;
                case VisualOrientation.Right:
                    rect.X--;
                    rect.Height--;
                    break;
            }

            // Add only the border for drawing
            switch (tabBorderStyle)
            {
                case TabBorderStyle.DockEqual:
                case TabBorderStyle.SquareEqualSmall:
                case TabBorderStyle.SquareEqualMedium:
                case TabBorderStyle.SquareEqualLarge:
                    AddSquarePath(borderPath, orientation, rect, forBorder);
                    break;
                case TabBorderStyle.DockOutsize:
                case TabBorderStyle.SquareOutsizeSmall:
                case TabBorderStyle.SquareOutsizeMedium:
                case TabBorderStyle.SquareOutsizeLarge:
                    rect = AdjustOutsizeTab(state, rect, orientation);
                    AddSquarePath(borderPath, orientation, rect, forBorder);
                    break;
                case TabBorderStyle.RoundedEqualSmall:
                case TabBorderStyle.RoundedEqualMedium:
                case TabBorderStyle.RoundedEqualLarge:
                    AddRoundedPath(borderPath, orientation, rect, forBorder);
                    break;
                case TabBorderStyle.RoundedOutsizeSmall:
                case TabBorderStyle.RoundedOutsizeMedium:
                case TabBorderStyle.RoundedOutsizeLarge:
                    rect = AdjustOutsizeTab(state, rect, orientation);
                    AddRoundedPath(borderPath, orientation, rect, forBorder);
                    break;
                case TabBorderStyle.SlantEqualNear:
                case TabBorderStyle.SlantOutsizeNear:
                    if (tabBorderStyle == TabBorderStyle.SlantOutsizeNear)
                        rect = AdjustOutsizeTab(state, rect, orientation);

                    if (rtl && ((orientation == VisualOrientation.Top) || (orientation == VisualOrientation.Bottom)))
                        AddSlantFarPath(borderPath, orientation, rect, forBorder);
                    else
                        AddSlantNearPath(borderPath, orientation, rect, forBorder);
                    break;
                case TabBorderStyle.SlantEqualFar:
                case TabBorderStyle.SlantOutsizeFar:
                    if (tabBorderStyle == TabBorderStyle.SlantOutsizeFar)
                        rect = AdjustOutsizeTab(state, rect, orientation);

                    if (rtl && ((orientation == VisualOrientation.Top) || (orientation == VisualOrientation.Bottom)))
                        AddSlantNearPath(borderPath, orientation, rect, forBorder);
                    else
                        AddSlantFarPath(borderPath, orientation, rect, forBorder);
                    break;
                case TabBorderStyle.SlantEqualBoth:
                case TabBorderStyle.SlantOutsizeBoth:
                    if (tabBorderStyle == TabBorderStyle.SlantOutsizeBoth)
                        rect = AdjustOutsizeTab(state, rect, orientation);

                    AddSlantBothPath(borderPath, orientation, rect, forBorder);
                    break;
                case TabBorderStyle.OneNote:
                    // Is the current tab selected?
                    bool selected = (state == PaletteState.CheckedNormal) ||
                                    (state == PaletteState.CheckedPressed) ||
                                    (state == PaletteState.CheckedTracking);

                    // The right padding depends on the selected state
                    int rp = (selected ? _spacingTabOneNoteRPS : _spacingTabOneNoteRPI);

                    // If not selected then need to make the tab shorter
                    if (!selected)
                        rect = AdjustOneNoteTab(rect, orientation);

                    if (rtl && ((orientation == VisualOrientation.Top) || (orientation == VisualOrientation.Bottom)))
                        AddOneNoteReversePath(borderPath, orientation, rect, forBorder, rp);
                    else
                        AddOneNotePath(borderPath, orientation, rect, forBorder, rp);
                    break;
                case TabBorderStyle.SmoothEqual:
                case TabBorderStyle.SmoothOutsize:
                    // Adjust the outsize tab variant
                    if (tabBorderStyle == TabBorderStyle.SmoothOutsize)
                        rect = AdjustSmoothTab(state, rect, orientation);

                    AddSmoothPath(borderPath, orientation, rect, forBorder);
                    break;
                default:
                    // Should never happen!
                    Debug.Assert(false);
                    break;
            }
        }
RenderStandard