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

DrawDragDockingSquaresMiddle() private method

private DrawDragDockingSquaresMiddle ( Graphics g, Color activeColor, Color inactiveColor, RenderDragDockingData dragData ) : void
g System.Drawing.Graphics
activeColor Color
inactiveColor Color
dragData RenderDragDockingData
return void
        private void DrawDragDockingSquaresMiddle(Graphics g,
                                                  Color activeColor,
                                                  Color inactiveColor,
                                                  RenderDragDockingData dragData)
        {
            Color borderColour = ControlPaint.Dark(activeColor);

            // Draw border around the window square
            using (Pen borderPen = new Pen(borderColour),
                       dashPen = new Pen(borderColour),
                       shadow1Pen = new Pen(_190),
                       shadow2Pen = new Pen(_218))
            {
                // Draw the caption area at top of window
                using (LinearGradientBrush middleBrush = new LinearGradientBrush(new Rectangle(32, 34, 21, 1), ControlPaint.LightLight(inactiveColor), activeColor, 0f),
                                           bottomBrush = new LinearGradientBrush(new Rectangle(32, 35, 21, 1), ControlPaint.Light(activeColor), activeColor, 0f))
                {
                    // Draw border
                    g.DrawLine(borderPen, 32, 32, 54, 32);
                    g.DrawLine(borderPen, 32, 32, 32, 53);
                    g.DrawLine(borderPen, 32, 53, 33, 54);
                    g.DrawLine(borderPen, 33, 54, 41, 54);
                    g.DrawLine(borderPen, 41, 54, 42, 52);
                    g.DrawLine(borderPen, 42, 52, 42, 50);
                    g.DrawLine(borderPen, 42, 50, 54, 50);
                    g.DrawLine(borderPen, 54, 32, 54, 53);
                    g.DrawLine(borderPen, 54, 53, 53, 54);
                    g.DrawLine(borderPen, 53, 54, 49, 54);
                    g.DrawLine(borderPen, 49, 54, 48, 53);
                    g.DrawLine(borderPen, 48, 53, 48, 50);
                    g.DrawLine(borderPen, 48, 53, 47, 54);
                    g.DrawLine(borderPen, 47, 54, 43, 54);
                    g.DrawLine(borderPen, 43, 54, 42, 53);

                    // Draw the caption area
                    g.FillRectangle(middleBrush, 33, 33, 21, 1);
                    g.FillRectangle(bottomBrush, 33, 34, 21, 1);

                    // Draw the client area
                    g.FillRectangle(SystemBrushes.Window, 33, 35, 21, 15);
                    g.FillRectangle(SystemBrushes.Window, 33, 50, 9, 3);
                    g.FillRectangle(SystemBrushes.Window, 33, 53, 9, 1);
                    g.FillRectangle(SystemBrushes.Window, 43, 51, 5, 3);
                    g.FillRectangle(SystemBrushes.Window, 49, 51, 5, 3);

                    // Fill the inner indicator area
                    using (SolidBrush innerBrush = new SolidBrush(Color.FromArgb(64, inactiveColor)))
                    {
                        g.FillRectangle(innerBrush, 34, 36, 19, 13);
                        g.FillRectangle(innerBrush, 34, 49, 7, 3);
                        g.FillRectangle(innerBrush, 35, 52, 5, 1);
                    }

                    // Draw outline of the indicator area
                    dashPen.DashStyle = DashStyle.Dot;
                    g.DrawLine(dashPen, 34, 37, 34, 52);
                    g.DrawLine(dashPen, 35, 52, 40, 52);
                    g.DrawLine(dashPen, 40, 51, 40, 49);
                    g.DrawLine(dashPen, 40, 51, 40, 48);
                    g.DrawLine(dashPen, 41, 48, 53, 48);
                    g.DrawLine(dashPen, 52, 47, 52, 36);
                    g.DrawLine(dashPen, 35, 36, 52, 36);

                    // Draw right han side shadow
                    g.DrawLine(shadow1Pen, 55, 33, 55, 53);
                    g.DrawLine(shadow2Pen, 56, 34, 56, 53);
                    g.DrawLine(shadow1Pen, 33, 55, 53, 55);
                    g.DrawLine(shadow1Pen, 53, 55, 55, 53);
                    g.DrawLine(shadow2Pen, 34, 56, 53, 56);
                    g.DrawLine(shadow2Pen, 53, 56, 56, 53);
                }

                // If active, then draw highlighted border
                if (dragData.ActiveMiddle)
                {
                    g.DrawLine(borderPen, 23, 29, 29, 23);
                    g.DrawLine(borderPen, 57, 23, 63, 29);
                    g.DrawLine(borderPen, 63, 57, 57, 63);
                    g.DrawLine(borderPen, 23, 57, 29, 63);
                }
            }
        }
RenderStandard