コード例 #1
0
        public IPackage OpenPackageForInstallation(string path)
        {
            Node <object> objNode = databaseManager.Find(path);

            if (objNode.TypedStreamExists(typeof(XmlDocument)))
            {
                XmlDocument     doc = objNode.ObjectOfType <XmlDocument>();
                AuthoredPackage pkg = AuthoredPackage.LoadFromXML(doc, componentEnvironment, path);
                pkg.Environment.SourcePath = Path.GetDirectoryName(path).Replace('\\', '/');
                return(pkg);
            }
            else if (objNode.TypedStreamExists(typeof(AuthoredPackage)))
            {
                AuthoredPackage pkg = objNode.ObjectOfType <AuthoredPackage>();
                pkg.Environment.SourcePath = path;
                /** FIXME: We need an CC.ReconfigureInstance() */
                return(pkg);
            }

            throw new Exception(String.Format("Path {0} is not supported", path));
        }