KnowDotNet Visual Organizer

Insert Missing XML Comments - CSharpCompleterPlus

Insert XML Comments in Whole Project or Solution

Every developer does not necessarily like or use the XML Comment auto documenting feature of C#. But for those who do, CSharpCompleterPlus provides, not only the automatic insertion of the XML comment block at the time a new function is created, but it also can scan a complete project and insert the XML documentation headers for any procedure that does not already have them.

This feature is activated by the
XML Comment Current Project menu option. It will go through your entire project and insert the XML headers for every function that does not have them. There is one caveat, it obviously cannot write to ReadOnly files. If you use SourceSafe and files are not checked out, or if for some other reason, files are ReadOnly, CSharpCompleterPlus will display a message box informing you of all files that are not processed due to their ReadOnly state. Therefore, you should check out all files that you want processed before invoking this feature.

The XML commenter feature will create a comment block like the one shown below. It adds a
TODO: keyword which causes all blocks needing comments updated to be placed in the Task List as TODO items when you Show All Tasks. Fortunately, double-clicking on a TODO item in the Task List will go to the TODO item in the respective code window.

   /// <summary>
   /// TODO: Add Summary of FunctionName
   /// <summary/>
   /// <parameter>parm1</parameter>
   /// <return>string</return>

Bypassing XML Comments for Form and Control Events

In good programming practices, you should not place a lot of code/business logic in Form and Control Events. For that reason, you may not want to put XML Comments in front of a Form or Control Event. You can have the Insert Missing XML Comments feature bypass these type of events by unchecking the Events Get XML Comments check box in the Setup Form. CSharpCompleterPlus determines that a method is an event by the presence of "_" in the method name and it has a parameter whose name is sender.

Writing Add-Ins for Visual Studio .NET
Writing Add-ins for Visual Studio .NET
by Les Smith
Apress Publishing