private void Window_Closed(object sender, EventArgs e) { _imageViewerControl.Disconnect(); _imageViewerControl.Close(); _imageViewerControl.Dispose(); if (_microphonePlayer != null) { _microphonePlayer.Disconnect(); _microphonePlayer.Close(); _microphonePlayer.Dispose(); } if (_speakerPlayer != null) { _speakerPlayer.Disconnect(); _speakerPlayer.Close(); _speakerPlayer.Dispose(); } if (_playbackFQID != null) { ClientControl.Instance.ReleasePlaybackController(_playbackFQID); _playbackFQID = null; } _mc?.Dispose(); _dateTimePicker?.Dispose(); _winFormsHost.Dispose(); }
/// <summary> /// Called by the Environment when the user log's out. /// You should close all remote sessions and flush cache information, as the /// user might logon to another server next time. /// </summary> public override void Close() { if (_SelectViewItemTimer != null) { _SelectViewItemTimer.Elapsed -= SelectViewItemTimer_Elapsed; _SelectViewItemTimer.Dispose(); } ClientControl.Instance.NewImageViewerControlEvent -= new ClientControl.NewImageViewerControlHandler(NewImageViewerControlEvent); if (_messageCommunication != null) { foreach (object messageRegistrationObject in _messageRegistrationObjects) { EnvironmentManager.Instance.UnRegisterReceiver(messageRegistrationObject); } _messageRegistrationObjects?.Clear(); _messageCommunication?.Dispose(); _messageCommunication = null; } }
/// <summary> /// Perform any cleanup stuff and event -= /// </summary> public override void Close() { _messageCommunication.Dispose(); }