|
Sometimes we take for granted that everyone knows the productivity tricks available to developers in Visual Studio .NET 2003. One of the coolest tricks provided through Class View is a built-in feature that will generate shell functions for any interface your class implements. Here’s how it works. Add a new class to a project, and create a class definition that includes the interface implementation list. In this example, I'm creating a new HTTP Module:
public class ErrorsGoHomeModule: IHttpModule
{
public ErrorsGoHomeModule()
{
}
}
Then, go to Class View:

Right click on the interface, in this case, IHttpModule, and select Add/Implement Interface…

This generates the following code in my example:
#region IHttpModule Members
public void Init(HttpApplication context)
{
// TODO: Add ErrorsGoHomeModule.Init implementation
}
public void Dispose()
{
// TODO: Add ErrorsGoHomeModule.Dispose implementation
}
#endregion
Now you’re ready to implement required members!
|