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

IsSegLineContained() private method

identify whether the segment is contained in the segments of a grid line
private IsSegLineContained ( List lines, SegmentLine2D lineB ) : bool
lines List /// the grid line (may contain the specified segment) ///
lineB SegmentLine2D /// the segment which needs to be identified ///
return bool
        private bool IsSegLineContained(List<SegmentLine2D> lines, SegmentLine2D lineB)
        {
            foreach (SegmentLine2D lineA in lines)
             {
            System.Drawing.Point lineAStartPoint = lineA.StartPoint;
            System.Drawing.Point lineAEndPoint = lineA.EndPoint;
            System.Drawing.Point lineBStartPoint = lineB.StartPoint;
            System.Drawing.Point lineBEndPoint = lineB.EndPoint;

            // the 2 lines have the same start point and the same end point
            if ((true == IsPointsEqual(lineAStartPoint, lineBStartPoint) && true == IsPointsEqual(lineAEndPoint, lineBEndPoint)) ||
                (true == IsPointsEqual(lineAStartPoint, lineBEndPoint) && true == IsPointsEqual(lineAEndPoint, lineBStartPoint)))
            {
               return true;
            }
             }

             return false;
        }