void Win7UIAClientForm_FormClosed(object sender, FormClosedEventArgs e) { if (_synth != null) { _synth.SpeakAsyncCancelAll(); _synth = null; } if (_highlight != null) { _highlight.Uninitialize(); _highlight = null; } if (_sampleFocusEventHandler != null) { _sampleFocusEventHandler.Uninitialize(); _sampleFocusEventHandler = null; } // Give any background threads created on startup a chance to close down gracefully. Thread.Sleep(200); }
///////////////////////////////////////////////////////////////////////////////////////////////// // // Win7UIAClientForm_FormClosed() // // Uninitialize and release everything created on startup. // ///////////////////////////////////////////////////////////////////////////////////////////////// void Win7UIAClientForm_FormClosed(object sender, FormClosedEventArgs e) { if (_linkProcessor != null) { _linkProcessor.Uninitialize(); _linkProcessor = null; } if (_highlight != null) { _highlight.Uninitialize(); _highlight = null; } if (_sampleEventHandler != null) { _sampleEventHandler.Uninitialize(); _sampleEventHandler = null; } // Give any background threads created on startup a chance to close down gracefully. Thread.Sleep(200); }