protected override void Dispose(bool disposing) { try { _videoPlayer.Hide(); Controls.Remove(_videoPlayer); _videoPlayer.Dispose(); } catch { } base.Dispose(disposing); }
protected override void Dispose(bool disposing) { try { // Remove the event handlers _videoPlayer.VideoError -= _videoPlayer_VideoError; _videoPlayer.VideoEnd -= _videoPlayer_VideoEnd; // Stop and Clear _videoPlayer.StopAndClear(); // Remove the control Controls.Remove(_videoPlayer); // Dispose of the Control _videoPlayer.Dispose(); } catch (Exception e) { Trace.WriteLine(new LogMessage("Video - Dispose", "Problem disposing of the Video Player. Ex = " + e.Message), LogType.Audit.ToString()); } base.Dispose(disposing); }