DesignSurface::Dispose Method ()

 

Releases the resources used by the DesignSurface.

Namespace:   System.ComponentModel.Design
Assembly:  System.Design (in System.Design.dll)

public:
virtual void Dispose() sealed

The public Dispose method follows the standard IDisposable pattern. Calling this method destroys the design surface. The protected version of this method is virtual and follows the normal IDisposable pattern.

System_CAPS_noteNote

Because DesignSurface does not have any native code to clean up, it does not have a finalizer that calls Dispose(Boolean). If you need to call Dispose(Boolean), you must add a finalizer yourself.

Call Dispose when you are finished using the DesignSurface. The Dispose method leaves the DesignSurface in an unusable state. After calling Dispose, you must release all references to the DesignSurface so the garbage collector can reclaim the memory that the DesignSurface was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

System_CAPS_noteNote

Always call Dispose before you release your last reference to the DesignSurface. Otherwise, the resources it is using will not be freed until the garbage collector calls the DesignSurface object's Finalize method.

.NET Framework
Available since 2.0
Return to top
Show: