Ejemplo n.º 1
0
        private TreeNode nonindexedNode(RelationshipDescriptor relDescr, RelationshipType relationship)
        {
            // Completely nonexistent dependency, e.g. "AJE"
            int icon = (int)relationship + 1;

            return(new TreeNode(relDescr.ToString() + " (not indexed)", icon, icon)
            {
                Name = relDescr.ToString(),
                ToolTipText = relationship.ToString(),
                ForeColor = Color.Red
            });
        }
Ejemplo n.º 2
0
        private TreeNode findDependencyShallow(IRegistryQuerier registry, RelationshipDescriptor relDescr, RelationshipType relationship, KspVersionCriteria crit)
        {
            // Maybe it's a DLC?
            if (relDescr.MatchesAny(
                    registry.InstalledModules.Select(im => im.Module),
                    new HashSet <string>(registry.InstalledDlls),
                    registry.InstalledDlc))
            {
                return(nonModuleNode(relDescr, null, relationship));
            }

            // Find modules that satisfy this dependency
            List <CkanModule> dependencyModules = relDescr.LatestAvailableWithProvides(registry, crit);

            if (dependencyModules.Count == 0)
            {
                // Nothing found, don't return a node
                return(null);
            }
            else if (dependencyModules.Count == 1 &&
                     relDescr.ContainsAny(new string[] { dependencyModules[0].identifier }))
            {
                // Only one exact match module, return a simple node
                return(indexedNode(registry, dependencyModules[0], relationship, crit != null));
            }
            else
            {
                // Several found or not same id, return a "provides" node
                return(providesNode(relDescr.ToString(), relationship,
                                    dependencyModules.Select(dep => indexedNode(registry, dep, relationship, crit != null))
                                    ));
            }
        }
Ejemplo n.º 3
0
        private TreeNode nonModuleNode(RelationshipDescriptor relDescr, ModuleVersion version, RelationshipType relationship)
        {
            int icon = (int)relationship + 1;

            return(new TreeNode($"{relDescr} {version}", icon, icon)
            {
                Name = relDescr.ToString(),
                ToolTipText = relationship.ToString()
            });
        }
Ejemplo n.º 4
0
        private TreeNode nonindexedNode(RelationshipDescriptor relDescr, RelationshipType relationship)
        {
            // Completely nonexistent dependency, e.g. "AJE"
            int icon = (int)relationship + 1;

            return(new TreeNode(string.Format(Properties.Resources.ModInfoNotIndexed, relDescr.ToString()), icon, icon)
            {
                Name = relDescr.ToString(),
                ToolTipText = relationship.ToString(),
                ForeColor = Color.Red
            });
        }