Exemplo n.º 1
0
        private void UpdateViewCollection()
        {
            DispatcherTimer dispatcherTimer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromMilliseconds(5000)
            };

            dispatcherTimer.Tick += (s, e) =>
            {
                dispatcherTimer.Stop();

                if (VideoItemViewCollection == null)
                {
                    return;
                }
                BackgroundService.Execute(() =>
                {
                    lock (Padlock)
                    {
                        this.IsLoading = true;
                        LoaderCompletion.FinishCollectionLoadProcess(VideoItemViewCollection, FilePageDispatcher);
                    }
                }, String.Format("Checking and updating files info in {0}", CurrentVideoFolder.Name), () => {
                    this.IsLoading = false;
                });
            };
            dispatcherTimer.Start();
        }
 private void InitFinishCollection()
 {
     DispatcherService.ExecuteTimerAction(() => {
         BackgroundService.Execute(() => {
             LoaderCompletion.FinishCollectionLoadProcess(PlayListCollection, null);
         }, "Getting playlist metadata...", () => { });
     }, 5000);
 }
Exemplo n.º 3
0
 private void UpdateViewCollection()
 {
     if (SearchResults.Count == 0)
     {
         return;
     }
     BackgroundService.Execute(() => {
         //this.IsLoading = true;
         LoaderCompletion.FinishCollectionLoadProcess(SearchResults, SearchPageDispatcher);
     }, String.Format("Updating files from search {0} result(s). ", ResultText));
 }
Exemplo n.º 4
0
        private void StartFileLoading()
        {
            if (UsbDrives != null && UsbDrives.Count == 0)
            {
                return;
            }

            var task = BackgroundService.Execute(() =>
            {
                LoaderCompletion.FinishCollectionLoadProcess(UsbDrives, true);
                FileLoader.InitGetAllFiles(UsbDrives);
            }, "Loading your movie folders!.", () =>
            {
                CommandManager.InvalidateRequerySuggested();
                RaisePropertyChanged(() => this.UsbDrives);
            });
        }
Exemplo n.º 5
0
 private void StartFileLoading()
 {
     if (AllFoldersList != null && AllFoldersList.Count == 0)
     {
         return;
     }
     var task = Task.Factory.StartNew(() =>
     {
         isLoadingData = true;
         LoaderCompletion.FinishCollectionLoadProcess(AllFoldersList, true);
         FileLoader.InitGetAllFiles(AllFoldersList);
     }).ContinueWith(t =>
     {
         isLoadingData = false;
         CommandManager.InvalidateRequerySuggested();
         FolderItemChange();
         ResetAllFolderListIsloadingFlag();
     }, TaskScheduler.FromCurrentSynchronizationContext());
 }