コード例 #1
0
 public static IDependency GetDependency(XPathNavigator dependencyNav)
 {
     IDependency dependency = null;
     string dependencyType = Util.ReadAttribute(dependencyNav, "type");
     switch (dependencyType.ToLowerInvariant())
     {
         case "coreversion":
             dependency = new CoreVersionDependency();
             break;
         case "package":
             dependency = new PackageDependency();
             break;
         case "permission":
             dependency = new PermissionsDependency();
             break;
         case "type":
             dependency = new TypeDependency();
             break;
         default:
             ListController listController = new ListController();
             ListEntryInfo entry = listController.GetListEntryInfo("Dependency", dependencyType);
             if (entry != null && !string.IsNullOrEmpty(entry.Text))
             {
                 dependency = (DependencyBase)Reflection.CreateObject(entry.Text, "Dependency_" + entry.Value);
             }
             break;
     }
     if (dependency == null)
     {
         dependency = new InvalidDependency(Util.INSTALL_Dependencies);
     }
     dependency.ReadManifest(dependencyNav);
     return dependency;
 }
コード例 #2
0
        public static IDependency GetDependency(XPathNavigator dependencyNav)
        {
            IDependency dependency     = null;
            string      dependencyType = Util.ReadAttribute(dependencyNav, "type");

            switch (dependencyType.ToLowerInvariant())
            {
            case "coreversion":
                dependency = new CoreVersionDependency();
                break;

            case "package":
                dependency = new PackageDependency();
                break;

            case "permission":
                dependency = new PermissionsDependency();
                break;

            case "type":
                dependency = new TypeDependency();
                break;

            default:
                ListController listController = new ListController();
                ListEntryInfo  entry          = listController.GetListEntryInfo("Dependency", dependencyType);
                if (entry != null && !string.IsNullOrEmpty(entry.Text))
                {
                    dependency = (DependencyBase)Reflection.CreateObject(entry.Text, "Dependency_" + entry.Value);
                }
                break;
            }
            if (dependency == null)
            {
                dependency = new InvalidDependency(Util.INSTALL_Dependencies);
            }
            dependency.ReadManifest(dependencyNav);
            return(dependency);
        }