Exemplo n.º 1
0
        private void ClearHandleProgress()
        {
            if (_progress != null)
            {
                _progress = null;
            }
            _progressObserver?.Dispose();

            _totalSizeInverted   = 0.0;
            DownloadProgress     = default;
            HasCacheProgress     = false;
            CacheProgressQuality = default;
        }
Exemplo n.º 2
0
 private void HandleProgress(Models.Cache.NicoVideoCacheProgress progress)
 {
     HasCacheProgress     = true;
     DownloadProgress     = default; // nullの時はゲージ表示を曖昧に表現する
     CacheProgressQuality = progress.Quality;
     IsProgressUnknown    = double.IsInfinity(progress.DownloadOperation.Progress.TotalBytesToReceive);
     _progress            = progress;
     _progressObserver    = _progress.ObserveProperty(x => x.Progress)
                            .Subscribe(async x =>
     {
         await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
         {
             DownloadProgress = x;
         });
     });
 }