ZForge.Controls.HeaderPanel.DrawShadow C# (CSharp) Method

DrawShadow() private method

private DrawShadow ( Graphics canvas ) : void
canvas Graphics
return void
        private void DrawShadow(Graphics canvas)
        {
            Pen pen = null;
            Color[] clrArr = null;

            try
            {
                clrArr = new Color[] {Color.FromArgb(142, 142, 142),
                                    Color.FromArgb(171, 171, 171),
                                    Color.FromArgb(212, 212, 212),
                                    Color.FromArgb(220, 220, 220)};
                for (int cntr = 0; cntr < 4; cntr++)
                {
                    pen = new Pen(clrArr[cntr], 1.0f);
                    canvas.DrawLine(pen, Width - (5 - cntr), ((cntr + 1) * 2),
                                                                    Width - (5 - cntr), Height - (5 - cntr));
                    canvas.DrawLine(pen, ((cntr + 1) * 2), Height - (5 - cntr),
                                                                    Width - (5 - cntr), Height - (5 - cntr));
                    pen.Dispose();
                    pen = null;
                }
            }
            finally
            {
                if (pen != null)
                {
                    pen.Dispose();
                    pen = null;
                }
                clrArr = null;
            }
        }