public void Dispose()
 {
     _disposeEvent.Set();
     if (_streamProxy != null)
     {
         _streamProxy.Dispose();
     }
     _streamProxy = null;
 }
 private void loadStreamProxy()
 {
     _streamProxy = new VideoStreamProxy();
     _streamProxy.TimePeriodsAllReceived        += onTimePeriodsAll;
     _streamProxy.TimePeriodsDownloadedReceived += onTimePeriodsDownloaded;
     _streamProxy.VideoBaseReceived             += onVideoBase;
     _streamProxy.VideoStreamsReceived          += onVideoStream;
     _streamProxy.MessageReceived      += onMessage;
     _streamProxy.DownloadPathReceived += onDownloadPathReceived;
 }