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

Implementing Interfaces
Applies to: Visual Studio .NET 2002, Visual Studio .NET 2003, Visual Studio 2005, Visual Studio 2008

One of the inheritance methods supported by .NET is interface inheritance, which means that a type can inherit another type (known as an interface) by implementing all its methods but without inheriting implementations (actually the base type - that is, the interface - does not have implementations for its members).

When a type inherits an interface it must provide implementations for all the methods defined by that interface. Although an interface can't inherit another type's implementation, it can inherit the definitions found in other interfaces, so a type which inherits an interface must additionally implement all the methods defined by any of that interface's inherited interfaces as well. Implementing all these methods turns out to be a really tedious task in real life, so CodeSMART comes with an automatic interface implementation mechanism which will definitely save you a lot of time and coding efforts.

To implement an interface:

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

    The Implement Interface dialog will be displayed:
  3. Specify which interface you want to implement by choosing one of the available combo box items. Check the Show parent namespace name option if you want CodeSMART to display the interface name along with the containing namespace name.
  4. Generate XML comments: check this option if you want XML descriptive comments to be generated for the newly inserted code.
  5. You can enclose the generated code between #Region and #End Region directives by checking the corresponding option.
  6. Press the Standards button in order to review the naming standards configuration since this one will be considered when generating code.
  7. Press Insert to generate and insert the desired code based on the above specified settings.
See Also
Advanced Code Builders Overview
Implementing Object Construction and Destruction
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