Formerly partner of GROSSWEBER. They practice what they preach. They offer trainings for modern software technologies like Behavior Driven Development, Clean Code, Git, HTML5 and, my personal favorite, Expression Blend. Their staff is fluent in a variety of languages, including English.
Commenting your source is recommended and pretty helpful. But while implementing (e.g. SharpTM) most time it is annoying to scroll through all the big comment blocks. To get an overview of all class members it would be great to have the opportunity to collapse all comment blocks above all methods, properties, etc. That's why I tried to find a macro to do this - without success. So I wrote it by my own based on a region collapse macro I found here. And this is the modified function to do the job:
Public IsSummaryCommentsOutlineCollapsed As Dictionary(Of Document, Boolean)
'' Toggling all <summary> comment blocks from collapsed to expanded outline.
'' Please add [Imports System.Collections.Generic] on top of this module.
If (DTE.ActiveDocument Is Nothing) Then
If (DTE.UndoContext.IsOpen) Then
DTE.SuppressUI = True
If (IsSummaryCommentsOutlineCollapsed Is Nothing) Then
IsSummaryCommentsOutlineCollapsed = New Dictionary(Of Document, Boolean)
If (Not IsSummaryCommentsOutlineCollapsed.ContainsKey(DTE.ActiveDocument)) Then
Dim objSelection As TextSelection = DTE.ActiveDocument.Selection
Dim line As Integer = objSelection.CurrentLine
' find all <summary> blocks
While objSelection.FindText("^:b*///:b*\<summary\>.*$", vsFindOptions.vsFindOptionsRegularExpression Or vsFindOptions.vsFindOptionsMatchInHiddenText)
If (Not IsSummaryCommentsOutlineCollapsed.Item(DTE.ActiveDocument)) Then
IsSummaryCommentsOutlineCollapsed.Item(DTE.ActiveDocument) = Not IsSummaryCommentsOutlineCollapsed.Item(DTE.ActiveDocument)
DTE.SuppressUI = False
In addition I just assigned a shortcut (Ctrl-M, C) to this macro to provide quick access while editing my sources.
Update: Due to a comment of Torsten to add an undo option I implemented the support for toggling between collapsed and expanded mode and the undo functionality. Now running the ToggleSummaryCommentsOutlineExpansion function will collapse the first time for each document and toggles between expanded and collapsed mode each time you trigger this method.
My name is Marcel Hoyer. I live in Leipzig, Germany, with a cat and three co-residents. I am a software developer at CID, a Software firm located in Germany. The CID Group focuses on the development of customized, up-to-date software solutions that digitalize and enhance business processes within enterprises and lead to an improvement of communication in relationships between companies and their customers. Next to those technological hobbies I like digital art, photography, travelling and music.
Powered by: newtelligence dasBlog 2.3.9074.18820
The opinions expressed herein are my own personal opinions and do not represent
my employer's view in anyway.
© Copyright 2004-2017, Marcel Hoyer