// Constructor internal UserInterface(ItvApp.AddIn addin) { _addin = addin; _overlaySurface = _addin.OverlaySurface; _videoSurface = _addin.VideoSurface; _tuning = _addin.Tuning; _session = _addin.Session; // create the object to receive keyboard hits. _eventHandler = new EventHandlerDelegate(_session, _tuning, _overlaySurface, this); // create a new audiostreamswticher _audioStreamSwitcher = new AudioStreamSwitcher(addin); }
// Initilize method to uninitialize the members public void Uninitialize() { _description = null; // delete the overlaySurface. if (null != _overlaySurface) { _overlaySurface.Visible = false; _overlaySurface.Free(); _overlaySurface = null; } if (null != _videoSurface) { _videoSurface = null; } // remove the Tuning object if (null != _tuning) { _tuning = null; } // remove the event handler object if (null != _eventHandler) { _eventHandler.UnInitialize(); _eventHandler = null; } // delete the session object if (null != _session) { _session = null; } // delete the AudioStreamSwitcher if (null != _audioStreamSwitcher) { _audioStreamSwitcher.Uninitialize(); _audioStreamSwitcher = null; } }