I have a class which implements UserControl. In .NET 2005, a Dispose method is automatically created in the MyClass.Designer.cs partial class file that looks like this:
protected override void Dispose(bool disposing)
if (disposing && (components != null))
In such a case I move the generated
Dispose method to the main file and extend it. Visual Studio respects this.
An other approach would be using a partial method (C# 3.0).