Revit.SDK.Samples.CurtainWallGrid.CS.GridDrawing.DrawVLines C# (CSharp) Method

DrawVLines() private method

draw the V grid lines
private DrawVLines ( Graphics graphics, Pen lockPen, Pen unlockPen ) : void
graphics System.Drawing.Graphics /// used in drawing the lines ///
lockPen System.Drawing.Pen /// the pen used to draw the locked grid line ///
unlockPen System.Drawing.Pen /// the pen used to draw the unlocked grid line ///
return void
        private void DrawVLines(Graphics graphics, Pen lockPen, Pen unlockPen)
        {
            foreach (GridLine2D line2D in m_vGridLines2D)
             {
            Pen pen = (true == line2D.Locked) ? lockPen : unlockPen;
            Pen isolatedPen = new Pen(Brushes.Gray, pen.Width);
            // won't draw the grid lines at GridLine2D level, draw them at SegmentLine2D level
            // at the skipped segments in the grid line won't be painted to the canvas
            foreach (SegmentLine2D segLine2D in line2D.Segments)
            {
               // skip the removed segments, won't draw them
               if (true == segLine2D.Removed)
               {
                  continue;
               }
               else if (true == segLine2D.Isolated)
               {
                  graphics.DrawLine(isolatedPen, segLine2D.StartPoint, segLine2D.EndPoint);
               }
               else
               {
                  graphics.DrawLine(pen, segLine2D.StartPoint, segLine2D.EndPoint);
               }
            }
             }
        }