/// <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);
     }
 }
示例#2
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);
     }
 }
        public void ShouldDetermine_SystemType_AndSaveItInConfiguration(string systemType)
        {
            var configurationManager = _configManagerMock.Object;

            _fileSystemManagerMock.Setup(x => x.DirectoryExists($"{configurationManager.UserConfig.GamePath}")).Returns(true);
            _fileSystemManagerMock.Setup(x => x.DirectoryExists($"{configurationManager.UserConfig.GamePath}\\{systemType}")).Returns(true);

            var configuration = new GW2_Addon_Manager.Configuration(configurationManager, _updateHelperMock.Object,
                                                                    _fileSystemManagerMock.Object);

            configuration.DetermineSystemType();

            Assert.That(configurationManager.UserConfig.BinFolder, Is.EqualTo(systemType));
            Assert.That(configurationManager.UserConfig.ExeName, Is.EqualTo(systemType.EndsWith("64") ? "Gw2-64.exe" : "Gw2.exe"));
        }
示例#4
0
        /// <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;

            _configurationManager = new ConfigurationManager();
            var configuration = new Configuration(_configurationManager);

            configuration.CheckSelfUpdates();
            configuration.DetermineSystemType();
            _pluginManagement = new PluginManagement(_configurationManager);
            _pluginManagement.DisplayAddonStatus();

            InitializeComponent();
            //update notification
            if (File.Exists(UpdateNotificationFile))
            {
                Process.Start(releases_url);
                File.Delete(UpdateNotificationFile);
            }
        }
        /// <summary>
        /// This constructor deals with creating or expanding the configuration file, setting the DataContext, and checking for application updates.
        /// </summary>
        public OpeningView()
        {
            _viewModel  = OpeningViewModel.GetInstance;
            DataContext = _viewModel;

            _configurationManager = new ConfigurationManager();

            var configuration = new Configuration(_configurationManager, new UpdateHelper(new WebClientWrapper()), new FileSystemManager());

            configuration.DetermineSystemType();

            _pluginManagement = new PluginManagement(_configurationManager);
            _pluginManagement.DisplayAddonStatus();

            InitializeComponent();
            SetUpdateButtonVisibility(configuration);

            //update notification
            if (File.Exists(UpdateNotificationFile))
            {
                Process.Start(releases_url);
                File.Delete(UpdateNotificationFile);
            }
        }