|
| ||||||||||
InstallationThe download includes an installer. Just quit all running instances of Visual Studio, run the installer executable, and hit the install button. This installer simply copies a few files onto your PC (in your My Documents folder). The next time you run Visual Studio, the Addin will auto load and place a new AtomineerUtils menu on the Tools menu. Note that the installer must be copied onto your computer's hard drive to be run. Due to the executable security features in .net 2.0 it may fail if an attempt is made to run it directly from a LAN folder. You can link the Addin commands to keypresses as follows:
Multi-user Installation
Disabling or Uninstalling AtomineerUtils AtomineerUtils can be temporarily disabled in Visual Studio by choosing the Tools > Add-in Manager menu item, and un-ticking the checkbox to the left of the AtomineerUtils add-in. To uninstall AtomineerUtils, quit all running instances of Visual Studio. Now open the installation folder (this is usually the 'My Documents' folder - you can run the installer to be reminded of the install location). The install folder contains 'Visual Studio 2005', 'Visual Studio 2008', and 'Visual Studio 10' sub-folders, each of which contains an 'Addins' folder. Delete the 'AtomineerUtils.Addin' file from each of these Addins folders. You may then delete the Visual Studio 2008\Addins\AtomineerUtils folder to remove all program files and your rules and preferences. Command Reference
Command: Add Doc Comment
This command creates or updates a Doxygen or DocXml-compatible description comment block for C#, C++/CLI, C++, C, or Visual Basic code. Usage
...and execute the command. Description
A number of helpful pieces of information are added to save you typing obvious comments, e.g:
Example function documentation headers, completely auto-generated. (Note that if you don't like the default style/layout of the comments, they are easily configurable (see some examples) in the AtomineerUtils Pro Options and also in Rules.xml. Note that the free version (AtomineerUtils) does not support this customisation option). ////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary> Event handler. Called by the TaskListCtrl for KeyDown events. </summary>
///
/// <remarks> Jason Williams, 12/04/2009. </remarks>
///
/// <param name='sender'> Source of the event. </param>
/// <param name='e'> Event information. </param>
////////////////////////////////////////////////////////////////////////////////////////////////////
void TaskListCtrl_KeyDown(object sender, KeyEventArgs e)
{
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary> Initialises the file buffer. </summary>
///
/// <remarks> Jason Williams, 12/04/2009. </remarks>
///
/// <exception cref="NotImplementedException"> Thrown when the requested operation is
/// unimplemented. </exception>
///
/// <param name="fname"> Filename of the file. </param>
/// <param name="buffSize"> Size of the buffer. </param>
/// <param name="resetCache"> true to reset cache. </param>
////////////////////////////////////////////////////////////////////////////////////////////////////
public void InitFileBuff(string fname, int buffSize, bool resetCache)
{
throw new NotImplementedException();
}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary> Gets or sets the foreground colour. </summary>
///
/// <value> The colour of the foreground. </value>
////////////////////////////////////////////////////////////////////////////////////////////////////
public Color FgColour { get {}; set {} }
For more examples see: DocXML format comments and Doxygen format comments. Note that these use the default style for the comments, but the style is very configurable (in AtomineerUtils Pro). See below for details. If a documentation comment already exists, it will be parsed and updated - for example if you add a new parameter to a function, or change a Property by adding a get/set method, the existing comment will be updated to reflect the new details. This feature will also serve to automatically convert most existing DocXml/Doxygen comments into the AtomineerUtils format, or to tidy doc comments after you have hand-edited them. If enabled, the word-wrap option will automatically reformat each comment entry to keep it tidy. The indentation level of the first line of each entry will be used in all subsequent lines. The word wrap will preserve blank lines, any lines at a greater indent level than the first line of the entry, and lines starting with certain text (examples (e.g., c.f., i.e.), bullet lists (starting with -, *, +), etc). In blocks of entries (e.g. <param> lists), the text within entries will all be lined up into a single column to enhance readability. In AtomineerUtils Pro, word wrap is suppressed for blocks of text that lie between <pre>, <code>, @code...@endcode, and @verbatim...@endverbatim tags. Note that these start/end tags must be the first nonblank text on the line. If enabled, the number of blank lines above and below the doc comment will be corrected to a user-specified standard to help keep code files tidy. The default is to enforce a single blank line above and below the comment. Any DocComment entries that are no longer required (e.g. deleted or renamed parameters) will be inserted at the end of the comment block in this form: ///### <param name='value'> This parameter has just been deleted</param> This preserves any text from these entries in case you wish to re-use it anywhere else (e.g. a renamed parameter). If you invoke the command a second time, any such 'deleted' lines will be automatically removed to save you having to manually clean up the comment.
Tips:
Changing the comment layout style (AtomineerUtils Pro only) The style of the comment blocks is quite configurable. High-level settings can be changed using the Atomineer Utils Options (available from the Atomineer.Utils menu in Visual Studio), while lower level improvements to the automatic documentation can be made by editing the Atomineer Auto-Documentation Rules XML file. See the Preferences and Doc Comment Rules sections below for details. Command: Document all in this scopeThis command searches a namespace, class, interface, struct, or enum scope and applies the Add Doc Comment command to each major code element within it. Usage
Description
This can be used in the following ways:
After executing this command it is highly recommended that you read through and update the resulting documentation to be sure that it is complete, correct and accurate. Command: Create C# or C++/CLI Property, Create C++ Access Methods
C++: Creates simple inlined "Get" and "Set" methods to access a member variable, making it much quicker and
easier to make members private and properly encapsulate your class data. Usage Description C++: Get and Set methods will be created, and inserted into the document above the preceeding "public/protected/private:" tag. For known simple types (int, float, etc) the accessors will pass by value. For unknown types, it assumes complex types (struct/class) and will pass by const-reference. (Pro only:) The names used for the getter/setter can be configured in the preferences. C++/CLI: A property is defined, and inserted into the document above the preceeding "public/protected/private:" tag. C# 2005: A property is defined, and is inserted immediately above the member variable declaration. The protection level for the variable will be changed to private, and the Property will use the protection level previously assigned to the variable (or public if it was private). It also adds attributes to improve debugging of the property (stops the debugger single-stepping into the property get/set function, and hides the member variable in the Locals window so that you don't end up with the property and the member variable both being displayed alongside each other). (A using System.Diagnostics; will be automatically added as well if required) C# 2008/2010: When executed on a member variable, it is converted into an auto-property. When executed on an auto-property, it is converted into an explicitly implemented property with a backing field. The backing field will use the variable naming style configured in the preferences. You can convert from a member variable to an explicit implementation by just executing the command twice in succession. A preference is provided to allow you to set a template for the backing field naming style. For an auto-property called 'MyProp', the default (a blank prefix) is to generate a backing field 'myProp'. With a template specified, other styles (e.g. '_MyProp', 'm_MyProp' 'mMyProp', '_Member_MyProp_' can be generated. Note that debugger attributes are not added in VS2008/2010, as these IDEs provide much better debugger stepping facilities, so the attributes are no longer necessary. Before (C++)public: private: int mInteger; MyClass mComplexClass;After (C++) public:
int GetInteger(void) const { return(mInteger); };
void SetInteger(int Integer) { mInteger = Integer; };
const MyClass &GetComplexClass(void) const { return(mComplexClass); };
void SetComplexClass(const MyClass &ComplexClass) { mComplexClass = ComplexClass; };
private:
int mInteger;
MyClass mComplexClass;
After (C++/CLI) public:
property int Integer
{
int get() { return(mInteger); }
void set(int value) { mInteger = value; }
}
property const MyClass& ComplexClass
{
const MyClass& get() { return(mComplexClass); }
void set(const MyClass& value) { mComplexClass = value; }
}
private:
int mInteger;
MyClass mComplexClass;
C# (VS2005) public int Integer
{
[DebuggerStepThrough] get { return(mInteger); }
[DebuggerStepThrough] set { mInteger = value; }
}
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private int mInteger;
C# (VS2008/2010)
// Original variable
private int mSpeed;
// After one execution, an auto-property
public int Speed { get; set; }
// After the second execution, an explicit property with backing field
public int Speed
{
get { return(mSpeed); }
set { mSpeed = value; }
}
private int mSpeed;
Command: Implement/Declare C++ method
(C++ only)
Usage Description
When executed in a source (.cpp) file: For this command to work, the .cpp and .h file must have a common filename, and both be part of your Visual Studio Project. Header declaration: // Creates a new Thingummy containing the required number of Wotsits Thingummy *CreateThingummy(CreateInfo *pInfo, int NumWotsits = 12) const; Resulting source file implementation (with doxygen-style comment) ////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn Thingummy *MyClass::CreateThingummy(CreateInfo *pInfo, int NumWotsits)
///
/// \author Jason Williams
/// \date 6/6/2005
///
/// \brief Creates a new Thingummy containing the required number of Wotsits
///
/// \param pInfo If non-NULL, the information
/// \param NumWotsits The number of wotsits
///
/// \retval NULL if it fails, else
///
////////////////////////////////////////////////////////////////////////////////////////////////////
Thingummy *MyNamespace::MyClass::CreateThingummy(CreateInfo *pInfo, int NumWotsits) const
{
return(NULL);
}
Command: Open C/C++ Source or HeaderWhen executed in a C/C++ source/header file, opens the matching header/source file. Usage Description Command: Hide DocComments using OutliningUses Visual Studio's Outlining feature to hide all DocXml Comments in your code. Usage Description Command: Hide Attributes using OutliningUses Visual Studio's Outlining feature to hide Attributes in your C# code. Usage Description Command: Copy As Text
Copies selected text onto the clipboard in a simple, clean format for use in other programs. Usage Description This command addresses all of these issues by copying the selected text in your document to the clipboad as plain text. It (optionally) strips unnecessary indentation from the block, and (optionally) converts tabs into spaces. Note that for the formatting to appear correct in the pasted text, you must display it using a monospaced font (e.g. Courier New). Command: Word wrap comment
Word-wraps the text in a comment block. Usage Description PreferencesThe AtomineerUtils => Options... command will show a preferences window.
This allows you to choose from a number of options to tweak the commands to operate
as you want them to:
Doc Comment - General settings tab
In addition, these Doxygen-specific options can be set:
Doc Comment - Border Style tab This section controls the border of the doc comment (AtomineerUtils Pro only). There are two standard comment styles that Visual Studio will recognise (it will syntax colour them and extract them as documentation comments for intellisense). Doxygen also recognises and parses these formats, so they are the recommended base style:
AtomineerUtils Pro supports these formats (and more) by allowing you to define the format of optional first and last lines (the top and bottom 'separator' lines) and an optional prefix that is used on every line in the body of the comment. These can be almost anything you want, as long as they meet these primary requirements:
Any of these can be set to (none) to remove them from your comment style entirely. The default format is the 'triple slash' format with ////////// separator lines to demark the comment block, but several other common and demonstration formats are provided in the combo boxes, or you can type in a custom string. Note that the top separator can now be a multi-line block (using \n in the text to denote newlines). If you use this, you must use a /** ... */ comment style for AtomineerUtils to be able to correctly parse and update existing comments. Within this top separator, you can also optionally use %type% to embed the type of the code element (Class, Method, Property, Constructor, etc) and %name% to embed the code element's name in this separator section. A three-line demo format is available to trial this form. Lastly, AtomineerUtils can optionally enforce a specific number of blank lines above and/or below each DocComment to ensure a consistent style throughout your code with a minimum of effort.
Doc Comment - Entry Style tab
Live Preview pane This section (at the bottom of the three Doc Comment tabs) shows an example comment, illustrating the sort of style you can expect from the settings you have chosen. It updates live as you change the preferences. Note that this is a guide only, but it will give you a fairly reasonable idea of how the real comments will appear.
Source Outlining tab
A similar set of options are available when outlining Attributes
'Menu Items' allows you to hide menu items for AtomineerUtils commands that you don't use. Why clutter the VS menus with options you never use? This just helps to keep the user interface clean and useful. 'Copy as Plain Text command' allows you to control the format of the text that Copy As Text will place on the clipboard.
'Create Property/Accessor command' allows you to set a (C#, C++) member variable and (C++) method style templates. These are used in the following ways:
The core of the templates is the special text 'VarName' which is a placeholder for the actual variable name. This may have an arbitrary prefix and/or suffix. In addition, the casing style (VarName or varName) controls the casing of the result. The combo boxes supply predefined examples, or you can type your own custom templates in instead. 'Implement/Declare C++ method' command allows you to configure aspects of the implementation behaviour:
Doc Comment RulesThe DocComment output of AtomineerUtils is extremely configurable via a simple Xml file. Locate the file in your "My Documents" folder (or the install location you chose in the AtomineerUtils installer) under: My Documents\Visual Studio 2008\Addins\AtomineerUtils\Rules.xml The rules are very simple yet powerful. Usage of the rules is heavily documented within this Xml file to allow you to augment the rules for yourself. The rules fall into three main groups:
If you augment the rules, please consider emailing me your updated rules file for possible inclusion into following releases. | ||||||||||
| Copyright © 1996-2010 Atomineer. All Rights Reserved. Contact email address |