Visual Studio Marco : CollapseLogRegions

 

Sub CollapseLogRegions()
        Dim objSelection As TextSelection
        objSelection = DTE.ActiveDocument.Selection
        objSelection.StartOfDocument()
        While (objSelection.FindText( "^.*region.*(DEBUG|ERROR|INFO|WARN).*$" , vsFindOptions.vsFindOptionsRegularExpression))
            objSelection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn)
            DTE.ExecuteCommand("Edit.ToggleOutliningExpansion")
            objSelection.StartOfDocument()
        End While
        DTE.ActiveDocument.Selection.StartOfDocument()
End Sub

你可能感兴趣的:(log)