Esempio n. 1
0
        /// <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();
        }
Esempio n. 2
0
        /// <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);
        }
 /// <summary>
 /// This constructor deals with creating or expanding the configuration file, setting the DataContext, and checking for application updates.
 /// </summary>
 public OpeningView()
 {
     DataContext = OpeningViewModel.GetInstance;
     Configuration.CheckSelfUpdates();
     Configuration.DetermineSystemType();
     Configuration.DisplayAddonStatus();
     InitializeComponent();
     //update notification
     if (File.Exists(UpdateNotificationFile))
     {
         Process.Start(releases_url);
         File.Delete(UpdateNotificationFile);
     }
 }
Esempio n. 5
0
 /// <summary>
 /// This constructor deals with creating or expanding the configuration file, setting the DataContext, and checking for application updates.
 /// </summary>
 public AddOnSelector()
 {
     theViewModel = new OpeningViewModel();
     DataContext  = theViewModel;
     Configuration.CheckSelfUpdates(theViewModel);
     Configuration.DetermineSystemType();
     Configuration.DisplayAddonStatus(theViewModel);
     InitializeComponent();
     //update notification
     if (File.Exists(UpdateNotificationFile))
     {
         Process.Start(releases_url);
         File.Delete(UpdateNotificationFile);
     }
 }
Esempio n. 6
0
        /// <summary>
        /// Deletes all addons and resets config to default state.
        /// <seealso cref="OpeningViewModel.CleanInstall"/>
        /// <seealso cref="Configuration.DeleteAllAddons"/>
        /// </summary>
        public static void DeleteAll()
        {
            string deletemsg = "This will delete ALL add-ons from Guild Wars 2 and all data associated with them! Are you sure you wish to continue?";
            string secondPrecautionaryMsg = "Are you absolutely sure you want to delete all addons? This action cannot be undone.";

            //precautionary "are you SURE" messages x2
            if (MessageBox.Show(deletemsg, "Warning!", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
            {
                if (MessageBox.Show(secondPrecautionaryMsg, "Absolutely Sure?", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
                {
                    Configuration.DeleteAllAddons();
                }
            }

            //post-delete info message
            MessageBox.Show("All addons have been removed.", "Reverted to Clean Install", MessageBoxButton.OK, MessageBoxImage.Information);
            Configuration.DisplayAddonStatus();
        }