protected override void OnStartup(StartupEventArgs e) { PlasmaTools.Logger.DebugFormat("Starting up Sun.Plasma"); base.OnStartup(e); PlasmaTrayIcon.InitializeTrayIcon(); // Set static property to store the startup argument if (e.Args.Length == 1 && e.Args[0] == "UpdateSelfUpdater") UpdateSelfUpdater = true; else UpdateSelfUpdater = false; // Start application using the correct window if (UpdateSelfUpdater) { PlasmaTools.Logger.InfoFormat("Application was started with the \"UpdateSelfUpdater\" parameter. Updating SelfUpdater."); var window = new UpdateSelfUpdater(); window.Show(); } else { var window = new CheckForUpdates(); window.Show(); } }
private void vm_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "UpdateProgress") { this.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)delegate() { CtlProgress.Value = vm.SelfUpdaterApp.UpdateProgress; if (vm.SelfUpdaterApp.UpdateProgress == 1) { var window = new CheckForUpdates(); window.Show(); this.Close(); } }); } }
private void vm_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == "UpdateProgress") { this.Dispatcher.Invoke(DispatcherPriority.Normal, (Action) delegate() { CtlProgress.Value = vm.SelfUpdaterApp.UpdateProgress; if (vm.SelfUpdaterApp.UpdateProgress == 1) { var window = new CheckForUpdates(); window.Show(); this.Close(); } }); } }