Imports EnvDTE
Imports System

Public Module PointMacros

    Function VirtualPointStats(ByVal virtualPnt As VirtualPoint, Optional ByVal name As String = "VirtualPoint", Optional ByVal indentLevel As Integer = 0) As String
        Dim stats As String

        stats = Space(indentLevel * 4) + name + ":" + Environment.NewLine + _
            Space(indentLevel * 4) + "    Line                 = " + virtualPnt.Line.ToString() + Environment.NewLine + _
            Space(indentLevel * 4) + "    LineCharOffset       = " + virtualPnt.LineCharOffset.ToString() + Environment.NewLine + _
            Space(indentLevel * 4) + "    AbsoluteCharOffset   = " + virtualPnt.AbsoluteCharOffset.ToString() + Environment.NewLine + _
            Space(indentLevel * 4) + "    DisplayColumn        = " + virtualPnt.DisplayColumn.ToString() + Environment.NewLine + _
            Space(indentLevel * 4) + "    VirtualCharOffset    = " + virtualPnt.VirtualCharOffset.ToString() + Environment.NewLine + _
            Space(indentLevel * 4) + "    VirtualDisplayColumn = " + virtualPnt.VirtualDisplayColumn.ToString()

        Return stats
    End Function

    Function EditPointStats(ByVal editPnt As EditPoint, Optional ByVal name As String = "EditPoint", Optional ByVal indentLevel As Integer = 0) As String
        Dim stats As String

        stats = Space(indentLevel * 4) + name + ":" + Environment.NewLine + _
            Space(indentLevel * 4) + "    Line                 = " + editPnt.Line.ToString() + Environment.NewLine + _
            Space(indentLevel * 4) + "    LineCharOffset       = " + editPnt.LineCharOffset.ToString() + Environment.NewLine + _
            Space(indentLevel * 4) + "    AbsoluteCharOffset   = " + editPnt.AbsoluteCharOffset.ToString() + Environment.NewLine + _
            Space(indentLevel * 4) + "    DisplayColumn        = " + editPnt.DisplayColumn.ToString()

        Return stats
    End Function

    Function TextPointStats(ByVal textPnt As TextPoint, Optional ByVal name As String = "TextPoint", Optional ByVal indentLevel As Integer = 0) As String
        Dim stats As String

        stats = Space(indentLevel * 4) + name + ":" + Environment.NewLine + _
            Space(indentLevel * 4) + "    Line                 = " + textPnt.Line.ToString() + Environment.NewLine + _
            Space(indentLevel * 4) + "    LineCharOffset       = " + textPnt.LineCharOffset.ToString() + Environment.NewLine + _
            Space(indentLevel * 4) + "    AbsoluteCharOffset   = " + textPnt.AbsoluteCharOffset.ToString() + Environment.NewLine + _
            Space(indentLevel * 4) + "    DisplayColumn        = " + textPnt.DisplayColumn.ToString()

        Return stats
    End Function

    Function IsVirtualSpace(ByVal vrtPoint As VirtualPoint) As Boolean
        ' Description: Returns whether the VirtualPoint lies in virtual space

        Return vrtPoint.LineCharOffset <> vrtPoint.VirtualCharOffset
    End Function

End Module
