Beispiel #1
0
        private void StartSortWorker()
        {
            _log.Info("Initializing the SortWorker");
            _sortWorker = new BackgroundWorker();

            _sortWorker.DoWork += (s, e) =>
            {
                if (!_sortOrder.HasValue || !_sortOrder.Value)
                {
                    _sortOrder = true;
                    Textures   = new BindableCollection <TextureItemViewModel>(_textures.OrderBy(x => x.Model.FileNameWithoutExtension));
                }
                else if (_sortOrder.Value)
                {
                    _sortOrder = false;
                    Textures   = new BindableCollection <TextureItemViewModel>(_textures.OrderByDescending(x => x.Model.FileNameWithoutExtension));
                }
            };

            _sortWorker.RunWorkerCompleted += (s, e) =>
            {
                SetStatus();
                NotifyOfPropertyChange(() => TexturesToShow);
            };

            _log.Info("Starting the SortWorker");
            _sortWorker.RunWorkerAsync();
        }
Beispiel #2
0
        public IEnumerable <IResult> CommandExecute()
        {
            TotalFileOperationsByteVolume = CurrentFileOperationsByteVolume;
            DateTime startTime = DateTime.Now;

            foreach (VideoFileOperationCoroutine fo in fileOperationsStack.OrderByDescending(vfo => vfo.DesiredFileAction).ToList())
            {
                yield return(fo.OnWorkerThread
                             (
                                 string.Format("Processing requested Video File Operations ...\n\nStart time : {2:T}\n{0:F1} of {1:F1} MB processed...",
                                               (TotalFileOperationsByteVolume - CurrentFileOperationsByteVolume) / 1048576.0,
                                               TotalFileOperationsByteVolume / 1048576.0, startTime)
                             ));
            }
        }