示例#1
0
        private LocalPackageRepositoryList createLocalPackageRepositoryList(List <LocalTempList> list)
        {
            var localPackageRepositoryList = new LocalPackageRepositoryList();

            foreach (var manifest in list)
            {
                var manifestReader = new XPathManifestReader(manifest.LocalPath);

                var name    = manifestReader.GetValue(ConfigurationManager.AppSettings.Get("XPathToGetAppNameInManifest"));
                var version = manifestReader.GetValue(ConfigurationManager.AppSettings.Get("XPathToGetAppVersionInManifest"));
                var dependentPackageList = manifestReader.GetDependenApplicationExpression("/Package/Dependecies/Package",
                                                                                           ConfigurationManager.AppSettings.Get("XPathToDependencyAppName"),
                                                                                           ConfigurationManager.AppSettings.Get("XPathToDependencyAppVersion"));

                //Create the local package
                var package = new Package()
                {
                    ApplicationName    = name,
                    ApplicationVersion = version,
                    ForeignPath        = manifest.PackageStorePath,
                    DependentPackages  = new List <Package>()
                };

                //Create the local dependent packages
                foreach (var dependentPackage in dependentPackageList)
                {
                    package.DependentPackages.Add(new Package()
                    {
                        ApplicationName    = dependentPackage.Item1,
                        ApplicationVersion = dependentPackage.Item2
                    });
                }

                localPackageRepositoryList.Packages.Add(package);
            }

            _localTempStorage.CleanTempManifests();

            return(localPackageRepositoryList);
        }
示例#2
0
文件: Engine.cs 项目: emilw/MPack
        private LocalPackageRepositoryList createLocalPackageRepositoryList(List<LocalTempList> list)
        {
            var localPackageRepositoryList = new LocalPackageRepositoryList();

            foreach (var manifest in list)
            {
                var manifestReader = new XPathManifestReader(manifest.LocalPath);

                var name = manifestReader.GetValue(ConfigurationManager.AppSettings.Get("XPathToGetAppNameInManifest"));
                var version = manifestReader.GetValue(ConfigurationManager.AppSettings.Get("XPathToGetAppVersionInManifest"));
                var dependentPackageList = manifestReader.GetDependenApplicationExpression("/Package/Dependecies/Package",
                                                                                            ConfigurationManager.AppSettings.Get("XPathToDependencyAppName"),
                                                                                            ConfigurationManager.AppSettings.Get("XPathToDependencyAppVersion"));

                //Create the local package
                var package = new Package()
                    {
                        ApplicationName = name,
                        ApplicationVersion = version,
                        ForeignPath = manifest.PackageStorePath,
                        DependentPackages = new List<Package>()
                    };

                //Create the local dependent packages
                foreach (var dependentPackage in dependentPackageList)
                {
                    package.DependentPackages.Add(new Package()
                    {
                        ApplicationName = dependentPackage.Item1,
                        ApplicationVersion = dependentPackage.Item2
                    });
                }

                localPackageRepositoryList.Packages.Add(package);
            }

            _localTempStorage.CleanTempManifests();

            return localPackageRepositoryList;
        }