예제 #1
0
파일: Registry.cs 프로젝트: CodingWoes/CKAN
        public void LatestAvailable()
        {
            registry.AddAvailable(module);

            // Make sure it's there for 0.24.2
            Assert.AreEqual(module.ToString(), registry.LatestAvailable(identifier, v0_24_2).ToString());

            // But not for 0.25.0
            Assert.IsNull(registry.LatestAvailable(identifier, v0_25_0));

            // And that we fail if we ask for something we don't know.
            Assert.Throws <ModuleNotFoundKraken>(delegate
            {
                registry.LatestAvailable("ToTheMun", v0_24_2);
            });
        }
예제 #2
0
        private bool allowInstall(CkanModule module)
        {
            GameInstance     currentInstance = Main.Instance.Manager.CurrentInstance;
            IRegistryQuerier registry        = RegistryManager.Instance(currentInstance).registry;
            var installer = new ModuleInstaller(
                currentInstance,
                Main.Instance.Manager.Cache,
                Main.Instance.currentUser);

            return(installable(installer, module, registry) ||
                   Main.Instance.YesNoDialog(
                       string.Format(Properties.Resources.AllModVersionsInstallPrompt, module.ToString()),
                       Properties.Resources.AllModVersionsInstallYes,
                       Properties.Resources.AllModVersionsInstallNo));
        }
예제 #3
0
 private bool allowInstall(CkanModule module)
 {
     return(module.IsCompatibleKSP(Main.Instance.Manager.CurrentInstance.VersionCriteria()) ||
            Main.Instance.YesNoDialog(
                string.Format(Properties.Resources.AllModVersionsInstallPrompt, module.ToString()),
                Properties.Resources.AllModVersionsInstallYes,
                Properties.Resources.AllModVersionsInstallNo));
 }
예제 #4
0
 private bool allowInstall(CkanModule module)
 {
     return(installable(module) ||
            Main.Instance.YesNoDialog(
                string.Format(Properties.Resources.AllModVersionsInstallPrompt, module.ToString()),
                Properties.Resources.AllModVersionsInstallYes,
                Properties.Resources.AllModVersionsInstallNo));
 }
예제 #5
0
        /// <summary>
        /// React to double click of a version by prompting to install
        /// </summary>
        /// <param name="sender">The version list view</param>
        /// <param name="e">The mouse click event</param>
        public void VersionsListView_DoubleClick(object sender, MouseEventArgs e)
        {
            ListViewHitTestInfo info   = ((ListView)sender).HitTest(e.X, e.Y);
            ListViewItem        item   = info.Item;
            CkanModule          module = item.Tag as CkanModule;

            if (module.IsCompatibleKSP(Main.Instance.Manager.CurrentInstance.VersionCriteria()) &&
                Main.Instance.YesNoDialog(
                    string.Format(Properties.Resources.MainAllModVersionsInstallPrompt, module.ToString()),
                    Properties.Resources.MainAllModVersionsInstallYes,
                    Properties.Resources.MainAllModVersionsInstallNo))
            {
                Main.Instance.InstallModuleDriver(
                    RegistryManager.Instance(Main.Instance.Manager.CurrentInstance).registry,
                    module
                    );
            }
        }