Пример #1
0
        public static bool IsUpToDate(KitsObject availableKit, ImportedKit importedKit)
        {
            System.Version latestKitVersion = new System.Version (availableKit.Version);
            System.Version currentKitVersion = new System.Version (); // Default is 0.0

            if (importedKit != null) {
                currentKitVersion = importedKit.Instance.Version ();
            }

            return latestKitVersion <= currentKitVersion;
        }
Пример #2
0
        public static bool IsUpToDate(KitsObject availableKit, ImportedKit importedKit)
        {
            System.Version latestKitVersion  = new System.Version(availableKit.Version);
            System.Version currentKitVersion = new System.Version();              // Default is 0.0

            if (importedKit != null)
            {
                currentKitVersion = importedKit.Instance.Version();
            }

            return(latestKitVersion <= currentKitVersion);
        }
Пример #3
0
        private static void CleanKitUpgrade(string name)
        {
            Update.PeriodicUpdateManager.Continue();

            KitsObject kitsObject = Update.PeriodicUpdateManager.LatestAvailableKitsVersions().Find(
                k => k.Name.Equals(name, StringComparison.OrdinalIgnoreCase)
                );

            if (kitsObject != null)
            {
                Detail.Runner.StartCoroutine(new Custodian(kitsObject.Manifest).Clean());
            }
        }
Пример #4
0
            public KitRowData(KitsObject availableKit, ImportedKit importedKit)
            {
                this.AvailableKit = availableKit;
                this.ImportedKit  = importedKit;

                this.LatestVersion = availableKit.Version.ToString();
                this.IsUpToDate    = KitUtils.IsUpToDate(availableKit, importedKit);

                this.Name           = availableKit.Name;
                this.Status         = KitStatus.Available;
                this.CurrentVersion = new System.Version().ToString();                   // Default is 0.0

                if (importedKit != null)
                {
                    this.Name           = importedKit.Name;
                    this.Status         = KitUtils.StatusFor(importedKit);
                    this.CurrentVersion = importedKit.Instance.Version().ToString();
                }
            }
Пример #5
0
        private static KeyValuePair <DisplayedKitStatus, Version> DisplayedKitStatusAndVersion(KitsObject kit, ImportedKit imported)
        {
            DisplayedKitStatus kitStatus = DisplayedKitStatus.NotInstalled;

            System.Version kitVersion = new System.Version(kit.Version);

            if (imported != null && imported.Status == ImportedKit.InstallationStatus.Installed)
            {
                kitVersion = imported.Instance.Version();
                kitStatus  = kitVersion < new System.Version(kit.Version) ? DisplayedKitStatus.UpgradeAvailable : DisplayedKitStatus.Installed;
            }

            return(new KeyValuePair <DisplayedKitStatus, Version> (kitStatus, kitVersion));
        }
		private static KeyValuePair<DisplayedKitStatus, Version> DisplayedKitStatusAndVersion(KitsObject kit, ImportedKit imported)
		{
			DisplayedKitStatus kitStatus = DisplayedKitStatus.NotInstalled;
			System.Version kitVersion = new System.Version (kit.Version);
			
			if (imported != null && imported.Status == ImportedKit.InstallationStatus.Installed) {
				kitVersion = imported.Instance.Version ();
				kitStatus = kitVersion < new System.Version (kit.Version) ? DisplayedKitStatus.UpgradeAvailable : DisplayedKitStatus.Installed;
			}

			return new KeyValuePair<DisplayedKitStatus, Version> (kitStatus, kitVersion);
		}
Пример #7
0
            public KitRowData(KitsObject availableKit, ImportedKit importedKit)
            {
                this.AvailableKit = availableKit;
                this.ImportedKit = importedKit;

                this.LatestVersion = availableKit.Version.ToString ();
                this.IsUpToDate = KitUtils.IsUpToDate(availableKit, importedKit);

                this.Name = availableKit.Name;
                this.Status = KitStatus.Available;
                this.CurrentVersion = new System.Version ().ToString (); // Default is 0.0

                if (importedKit != null) {
                    this.Name = importedKit.Name;
                    this.Status = KitUtils.StatusFor (importedKit);
                    this.CurrentVersion = importedKit.Instance.Version ().ToString ();
                }
            }