Example #1
0
        protected void Dispose(Boolean freeManagedObjectsAlso)
        {
            //Free unmanaged resources
            _serviceClient.Unsubscribe();

            //Free managed resources too, but only if i'm being called from Dispose
            //(If i'm being called from Finalize then the objects might not exist
            //anymore
            if (freeManagedObjectsAlso)
            {
                _refreshTimer.Enabled = false;
            }
        }
Example #2
0
 void Form1_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 {
     _serviceClient.Unsubscribe();
 }