>Partial Class clsExamSelection > Inherits System.Windows.Forms.UserControl >. >. >. >End Class >>
>Public Class clsExamSelection : Implements IDisposable > > Public Overloads Sub Dispose() > '************************************************************************ > ' Procedure/Function: Dispose() > ' Author: Ben Santiago > ' Last Revision: 02/23/2007 > ' Description: > ' Disposes of internal resources (if any) and prevents the Finalize > ' routine from running so that the GarbageCollector doesn't attempt > ' to dispose this object again. > '************************************************************************ > > Dispose(True) > GC.SuppressFinalize(Me) > End Sub > > Protected Overridable Overloads Sub Dispose(ByVal Disposing As Boolean) > '************************************************************************ > ' Procedure/Function: Dispose() > ' Author: Ben Santiago > ' Last Revision: 02/23/2007 > ' Description: > ' Manually disposes additional objects if needed. > '************************************************************************ > > Try > If Disposing Then > '*************************************** > ' Dispose Of Individual Components > '*************************************** > If components IsNot Nothing Then > components.Dispose() > End If > End If > > '*************************************** > ' Remove Private DataSet > '*************************************** > MessageBox.Show("Removing DataSet") > Me.PrivateDataSet_Destroy() > Finally > '*************************************** > ' Call Base Dispose Method > '*************************************** > MyBase.Dispose(Disposing) > End Try > End Sub > > Protected Overrides Sub Finalize() > '************************************************************************ > ' Procedure/Function: Finalize() > ' Author: Ben Santiago > ' Last Revision: 02/23/2007 > ' Description: > ' Auto dispose this object when nothing references this object, > ' using Garbage Collection. > '************************************************************************ > > Dispose(False) > End Sub > >End Class >