Exemplo n.º 1
0
        public void ExecuteWorkflowStep(Job job)
        {
            _job         = job;
            OutputFormat = job.Profile.OutputFormat;
            var firstFile = job.OutputFiles.First();

            FileName      = System.IO.Path.GetFileName(firstFile);
            FileDirectory = System.IO.Path.GetDirectoryName(firstFile);
            FileSize      = _readableFileSizeHelper.GetFileSizeString(firstFile);
            RaisePropertyChanged(nameof(IsActive));
        }
        private void UpdateProgress(int progressPercentage)
        {
            ProgressPercentage = progressPercentage;
            RaisePropertyChanged(nameof(ProgressPercentage));

            DownloadSpeedText = string.Format("{0}/s - {1:0} s",
                                              _readableFileSizeFormatter.GetFileSizeString(_downloadSpeed.BytesPerSecond),
                                              _downloadSpeed.EstimatedRemainingDuration.TotalSeconds);

            if (progressPercentage == 100)
            {
                DownloadSpeedText = "";
            }

            RaisePropertyChanged(nameof(DownloadSpeedText));
        }
Exemplo n.º 3
0
        private void UpdateProgress(object sender, UpdateProgressChangedEventArgs args)
        {
            Dispatcher.BeginInvoke((Action <int>) delegate(int progress)
            {
                ProgressPercentage = progress;

                DownloadSpeedText = string.Format("{0}/s - {1:0} s",
                                                  _readableFileSizeFormatter.GetFileSizeString(_updateDownloader.DownloadSpeed.BytesPerSecond),
                                                  _updateDownloader.DownloadSpeed.EstimatedRemainingDuration.TotalSeconds);

                RaisePropertyChanged(nameof(ProgressPercentage));
                if (args.Progress == 100)
                {
                    DownloadSpeedText = "";
                }

                RaisePropertyChanged(nameof(DownloadSpeedText));
            }, args.Progress);
        }