Exemplo n.º 1
0
 public XmlPackage(IHttpNavigator httpNavigator, Uri link, string name, Version version, IEnumerable<IExportBuilder> builders)
 {
     _httpNavigator = httpNavigator;
     _builders = builders;
     Name = name;
     Version = version;
     _link = link;
 }
Exemplo n.º 2
0
        public XmlRepository(IHttpNavigator navigator, IEnumerable<IExportBuilder> builders)
        {
            var document = navigator.LoadFileList();

            PackagesByName = (from wrapList in document.Descendants("wrap")
                              let name = wrapList.Attribute("name")
                              let version = wrapList.Attribute("version")
                              let link = (from link in wrapList.Elements("link")
                                          let relAttribute = link.Attribute("rel")
                                          where relAttribute != null && relAttribute.Value.Equals("package", StringComparison.OrdinalIgnoreCase)
                                          select relAttribute).FirstOrDefault()
                              where name != null && version != null && link != null
                              let depends = wrapList.Elements("depends").Select(x => x.Value)
                              select new XmlPackageInfo(navigator, name.Value, version.Value,new Uri(link.Value, UriKind.RelativeOrAbsolute), depends, builders))
                .Cast<IPackageInfo>().ToLookup(x => x.Name);
        }
Exemplo n.º 3
0
 public XmlPackageInfo(IPackageRepository source, IHttpNavigator httpNavigator, string name, string version, Uri link, IEnumerable<string> depends, IEnumerable<IExportBuilder> builders)
 {
     Name = name;
     Version = new Version(version);
     Source = source;
     _httpNavigator = httpNavigator;
     _builders = builders;
     _link = link;
     Dependencies = (from dependency in depends
                     let strings = dependency.Split(new[] { " " }, StringSplitOptions.RemoveEmptyEntries)
                     where strings.Length >= 1
                     let dependencyName = strings[0]
                     where !string.IsNullOrEmpty(dependencyName)
                     select new WrapDependency
                     {
                         Name = dependencyName,
                         VersionVertices = WrapDependencyParser.ParseVersions(strings.Skip(1).ToArray()).ToList()
                     }).ToList();
 }