public EstimateThread(ImageShrinkerViewModel imageShrinkerViewModel) { _imageShrinkerViewModel = imageShrinkerViewModel; Idle = true; var task = new Task(Process); task.Start(); }
public override void Prepare(ImageShrinkerViewModel imageShrinkerViewModel, IBackgroundWorkerUi ui) { base.Prepare(imageShrinkerViewModel, ui); Ui.IsIndeterminate = false; Ui.ProgressMinimum = 0; Ui.ProgressMaximum = _files.Length - 1; }
public static void UnifyImageNames(ImageShrinkerViewModel imageShrinkerViewModel, string baseName) { var format = baseName + " " + GetUnifyNameFormat(imageShrinkerViewModel.Images.Count); var baseIndex = 0; foreach (var imageViewModel in imageShrinkerViewModel.Images) { imageViewModel.Name = string.Format(format, baseIndex++); } }
public override void Prepare(ImageShrinkerViewModel imageShrinkerViewModel, IBackgroundWorkerUi ui) { base.Prepare(imageShrinkerViewModel, ui); Ui.MessageText = "Deploy Images to Folder..."; Ui.IsIndeterminate = false; Ui.ProgressMinimum = 0; Ui.ProgressMaximum = ImageShrinkerViewModel.Images.Count - 1; _progressCounter = 0; }
public EMailSendViewModel(ImageShrinkerViewModel context) { _imageShrinkerViewModel = context; _providers = new ObservableCollection<EMailProviderViewModel> { new EMailProviderViewModel {Name = "Freenet", Smpt = Settings.Default.FreenetSmpt}, new EMailProviderViewModel {Name = "GMX", Smpt = Settings.Default.GmxSmpt}, new EMailProviderViewModel {Name = "T-Online", Smpt = Settings.Default.TOnlineSmpt}, new EMailProviderViewModel {Name = "Web.de", Smpt = Settings.Default.WebSmpt}, }; Subject = "Kein Betreff"; SendCommand = new ViewModelCommand(SendEMailExecuted); }
public static void ExecuteAsyncJob(ImageShrinkerViewModel context, IBackgroundWorkerUi uiResponder, IAsyncJob job) { var backgroundWorker = new BackgroundWorker(); backgroundWorker.DoWork += job.BackgroundWorkerOnDoWork; backgroundWorker.WorkerSupportsCancellation = true; backgroundWorker.RunWorkerCompleted += (s, e) => { uiResponder.OnWorkerCompleted(); AsyncJobRunning = false; }; uiResponder.Worker = backgroundWorker; job.Prepare(context, uiResponder); AsyncJobRunning = true; backgroundWorker.RunWorkerAsync(); uiResponder.AfterAsyncStart(); }
public static void ExecuteAsyncJobWithDialog(ImageShrinkerViewModel context, IBackgroundWorkerUi uiResponder, IAsyncJob job) { ExecuteAsyncJob(context, uiResponder, job); ShowDialog((ViewModel)uiResponder); }
public MainWindow() { InitializeComponent(); DataContext = new ImageShrinkerViewModel {ArchiveName = "BilderArchiv"}; Closing += MainWindowClosing; }
public override void Prepare(ImageShrinkerViewModel imageShrinkerViewModel, IBackgroundWorkerUi ui) { base.Prepare(imageShrinkerViewModel, ui); Ui.MessageText = "Loading Images..."; Ui.IsIndeterminate = true; }
public virtual void Prepare(ImageShrinkerViewModel imageShrinkerViewModel, IBackgroundWorkerUi ui) { ImageShrinkerViewModel = imageShrinkerViewModel; Ui = ui; }
public override void Prepare(ImageShrinkerViewModel imageShrinkerViewModel, IBackgroundWorkerUi ui) { base.Prepare(imageShrinkerViewModel, ui); Ui.ProgressMaximum += 2; }