コード例 #1
0
        private static void CheckForKitUpdates()
        {
            try {
                KitsList           available = LatestAvailableKitsVersions();
                List <ImportedKit> installed = KitUtils.ListImportedKits(null)().FindAll(
                    k => KitUtils.IsKitInstalled(k.Name)
                    );

                foreach (ImportedKit kit in installed)
                {
                    KitsObject upgradeable = available.Find(
                        k => k.Name.Equals(kit.Name, System.StringComparison.OrdinalIgnoreCase) && new System.Version(k.Version) > kit.Instance.Version()
                        );

                    if (upgradeable == null)
                    {
                        continue;
                    }

                    Utils.Log(
                        "{0} kit version {1} is available! Please open the Fabric plugin to install the latest version.",
                        upgradeable.Name,
                        upgradeable.Version
                        );
                }
            } catch (System.Exception) {
                Utils.Log("Couldn't determine whether kit updates are available!");
            }
        }
コード例 #2
0
        private static HashSet <VersionedDependency> Collect(DependencyGraphObject current, string kit, ref HashSet <VersionedDependency> collected)
        {
            KitsObject kitObject = current.Dependencies.Kits.Find(
                k => k.Name.Equals(kit, System.StringComparison.OrdinalIgnoreCase)
                );

            if (kitObject == null)
            {
                return(collected);
            }

            return(CollectTransitiveDependencies(current, kitObject.DependsOn, ref collected));
        }
コード例 #3
0
        public static bool IsPluginUpdateRequired(string name)
        {
            Dependency.DependencyGraphManager dg = updateChecker.GetDependencyGraphManager();
            if (dg == null)
            {
                return(false);
            }

            KitsObject found = dg.LatestAvailableKitVersions().Find(
                k => k.Name.Equals(name, System.StringComparison.OrdinalIgnoreCase)
                );

            return(found != null && new System.Version(found.MinimumPluginVersion) > Fabric.Internal.Editor.Info.Version);
        }
コード例 #4
0
        public static bool IsKitUpdateAvailable(string name, System.Version installedVersion)
        {
            Dependency.DependencyGraphManager dg = updateChecker.GetDependencyGraphManager();
            if (dg == null)
            {
                return(false);
            }

            KitsObject found = dg.LatestAvailableKitVersions().Find(
                k => k.Name.Equals(name, System.StringComparison.OrdinalIgnoreCase)
                );

            return(found != null && new System.Version(found.Version) > installedVersion);
        }