Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Documentator Macros
Documentator Macros

Documentator Macros

Dan Händevik

|
4,048 clicks
| (1) | Free
A set of macros useful for auto documentation and refactoring. Works with Visual Studio 2003, 2005 and 2008. Supports C# and VB.Net.
Get Started

If you want to write code faster, you need to be efficient with your IDE. The documentator macros is designed to add speed into the inline documentation of code and for common refactoring scenarios.

Auto documentation

Consider the following method that you need to document. Activate the DocumentThis macro (by using it's shortcut Ctrl+d)
   
    public bool IsAvaliable(string name)
    {
        if (name == null)
            throw new ArgumentNullException("name");

        //some code
    }

And you'll end up documented and regionized like below

    #region public bool IsAvaliable(string name)
    /// <summary>
    ///
    /// </summary>
    /// <param name="name"></param>
    /// <returns>True if it is avaliable, otherwise false.</returns>
    /// <exception cref="ArgumentNullException">If <paramref name="name"/> is null.</exception>
    public bool IsAvaliable(string name)
    {
        if (name == null)
            throw new ArgumentNullException("name");

        //some code
    }
    #endregion

Refactoring

For refactoring the following example can give a hint for its usability. Consider the field Name in the Employee class. We want to convert this to a property.

    public string Name;

Run the Refactoring macro (bound to Ctrl+Shift+j) on this field and get the output below

    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }
    private string _name;


Add the documentation and you will end with

    #region public string Name
    /// <summary>
    /// Get/Sets the Name of the Employee
    /// </summary>
    /// <value></value>
    public string Name
    {
        get { return _name; }
        set { _name = value; }
    }
    private string _name;
    #endregion

That produces eleven lines of code in two key combos and less than two seconds of work.

More information

Download the macros and check the included documentation for more information.

More information can be found at the following CodeProject article
http://www.codeproject.com/KB/cs/documentatormacros.aspx
or in my blog
http://dhvik.blogspot.com/search/label/Macros

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft