Exemple #1
0
        public GUIMod(CkanModule mod, Registry registry, KSPVersion ksp_version)
        {
            //Currently anything which could alter these causes a full reload of the modlist
            // If this is ever changed these could be moved into the properties
            Mod              = mod;
            IsInstalled      = registry.IsInstalled(mod.identifier);
            IsInstallChecked = IsInstalled;
            HasUpdate        = registry.HasUpdate(mod.identifier);
            IsIncompatible   = !mod.IsCompatibleKSP(ksp_version);
            IsAutodetected   = registry.IsAutodetected(mod.identifier);
            Authors          = mod.author == null ? "N/A" : String.Join(",", mod.author);

            var installedVersion = registry.InstalledVersion(mod.identifier);
            var latestVersion    = mod.version;
            var kspVersion       = mod.ksp_version;

            InstalledVersion = installedVersion != null?installedVersion.ToString() : "-";

            LatestVersion = latestVersion != null?latestVersion.ToString() : "-";

            KSPversion = kspVersion != null?kspVersion.ToString() : "-";

            Abstract = mod.@abstract;
            Homepage = mod.resources != null && mod.resources.homepage != null
                ? (object)mod.resources.homepage
                : "N/A";

            Identifier = mod.identifier;
        }