You are here: AxTools > CodeSMART 2009 for VS.NET > Documentation > User's Guide > Advanced Code Builders > Implementing Object Construction and Destruction
While browsing this page, why not start downloading the evaluation setup kit (direct download, no questions asked).

Implementing Object Construction and Destruction
Applies to: Visual Studio .NET 2002, Visual Studio .NET 2003, Visual Studio 2005, Visual Studio 2008

The Implement Object Construction and Destruction dialog can help you implement basic constructors for the objects and the usual methods for disposing them.

To implement object construction and destruction:

  1. Open the Visual Basic or C# code module containing the type you want to implement construction and destruction code for and place the cursor inside that type's code.
  2. In the CodeSMART main menu, select the Implement Object Construction and Destruction entry from the Code Builder Tools popup menu, Implement Advanced Code secondary popup, or choose the Object Construction and Destruction entry from the Implement toolbar popup (quick toolbar and menu references are available).

    The Implement Object Construction and Destruction dialog will be displayed:
  3. If you choose to implement constructors, specify the number of constructors to be added and specify if you want to call the base type's constructor. Because after the code insertion all the generated constructors will basically be identical in terms of contained code, you must make sure to provide different signatures for each of them.
  4. Check Add a 'Finalize' method if you want to implement the Finalize method.
  5. Check Implement the IDisposable interface if you want to implement the IDisposable.Dispose method.
  6. Generate XML comments: check this option if you want XML descriptive comments to be generated for the newly inserted code.
  7. You can enclose the generated code between #Region and #End Region directives by checking the corresponding option.
  8. Press the Standards button in order to review the naming standards configuration since this one will be considered when generating code.
  9. Press Insert to generate and insert the desired code based on the above specified settings.
See Also
Advanced Code Builders Overview
Implementing Interfaces
Implementing Common Object Operations
Implementing Member Override
Implementing Object Serialization and Deserialization
Implementing Event Definitions in C#
Inserting Custom Attribute Classes
Inserting Custom Exception Classes
Inserting Custom Formatter Classes
Inserting Strongly Typed Collection Classes

Back to top