public static async void UpdateAll() { UpdatingViewModel viewModel = UpdatingViewModel.GetInstance; LoaderSetup settingUp = new LoaderSetup(new ConfigurationManager()); await settingUp.HandleLoaderUpdate(); List <AddonInfoFromYaml> addons = (List <AddonInfoFromYaml>)Application.Current.Properties["Selected"]; var configurationManager = new ConfigurationManager(); foreach (AddonInfoFromYaml addon in addons.Where(add => add != null)) { GenericUpdater updater = new GenericUpdater(addon, configurationManager); if (!(addon.additional_flags != null && addon.additional_flags.Contains("self-updating") && configurationManager.UserConfig.AddonsList.FirstOrDefault(a => a.Name == addon.addon_name)?.Installed == true)) { await updater.Update(); } } viewModel.ProgBarLabel = "Updates Complete"; viewModel.DownloadProgress = 100; viewModel.CloseBtnEnabled = true; viewModel.BackBtnEnabled = true; }
/// <summary> /// Enables the currently selected addons. /// <seealso cref="OpeningViewModel.EnableSelected"/> /// </summary> public static void EnableSelected() { string enablemsg = "This will enable any of the selected add-ons that are disabled. Do you wish to continue?"; if (MessageBox.Show(enablemsg, "Enable", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes) { foreach (AddonInfoFromYaml addon in OpeningViewModel.GetInstance.AddonList.Where(add => add.IsSelected == true)) { GenericUpdater.enable(addon); } } Configuration.DisplayAddonStatus(); }
/// <summary> /// Deletes the currently selected addons. /// <seealso cref="OpeningViewModel.DeleteSelected"/> /// </summary> public static void DeleteSelected() { string deletemsg = "This will delete any add-ons that are selected and all data associated with them! Are you sure you wish to continue?"; if (MessageBox.Show(deletemsg, "Warning!", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { foreach (AddonInfoFromYaml addon in OpeningViewModel.GetInstance.AddonList.Where(add => add.IsSelected == true)) { GenericUpdater.delete(addon); } } Configuration.DisplayAddonStatus(); }
/// <summary> /// Disables the currently selected addons. /// <seealso cref="OpeningViewModel.DisableSelected"/> /// </summary> /// <param name="viewModel">The DataContext for the application UI.</param> public static void DisableSelected(OpeningViewModel viewModel) { string disablemsg = "This will disable the selected add-ons until you choose to re-enable them. Do you wish to continue?"; if (MessageBox.Show(disablemsg, "Disable", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes) { foreach (AddonInfo addon in viewModel.AddonList.Where(add => add.IsSelected == true)) { GenericUpdater.disable(addon); } } Configuration.DisplayAddonStatus(viewModel); }
public static async void UpdateAll(UpdatingViewModel viewModel) { LoaderSetup settingUp = new LoaderSetup(viewModel); await settingUp.handleLoaderInstall(); List <AddonInfo> addons = (List <AddonInfo>)Application.Current.Properties["Selected"]; foreach (AddonInfo addon in addons.Where(add => add != null)) { GenericUpdater updater = new GenericUpdater(addon, viewModel); await updater.Update(); } viewModel.label = "Updates Complete"; viewModel.showProgress = 100; viewModel.closeButtonEnabled = true; }
public static async void UpdateAll() { UpdatingViewModel viewModel = UpdatingViewModel.GetInstance; LoaderSetup settingUp = new LoaderSetup(); await settingUp.HandleLoaderUpdate(); List <AddonInfoFromYaml> addons = (List <AddonInfoFromYaml>)Application.Current.Properties["Selected"]; foreach (AddonInfoFromYaml addon in addons.Where(add => add != null)) { GenericUpdater updater = new GenericUpdater(addon); await updater.Update(); } viewModel.ProgBarLabel = "Updates Complete"; viewModel.DownloadProgress = 100; viewModel.CloseBtnEnabled = true; }
public static async void UpdateAll() { UpdatingViewModel viewModel = UpdatingViewModel.GetInstance; LoaderSetup settingUp = new LoaderSetup(); await settingUp.HandleLoaderUpdate(); List <AddonInfoFromYaml> addons = (List <AddonInfoFromYaml>)Application.Current.Properties["Selected"]; foreach (AddonInfoFromYaml addon in addons.Where(add => add != null)) { GenericUpdater updater = new GenericUpdater(addon); if (!(addon.additional_flags != null && addon.additional_flags.Contains("self-updating") && Configuration.getConfigAsYAML().installed.ContainsKey(addon.folder_name))) { await updater.Update(); } } viewModel.ProgBarLabel = "Updates Complete"; viewModel.DownloadProgress = 100; viewModel.CloseBtnEnabled = true; viewModel.BackBtnEnabled = true; }