Exemplo n.º 1
0
        /// <summary>
        /// Searches for packages based on the configured parameters.
        /// </summary>
        /// <param name="behavior">The <see cref="CompositeSearchBehavior" /> value.</param>
        /// <param name="limit">The limit on the number of matches returned.</param>
        /// <returns>A list of <see cref="MatchResult" /> objects.</returns>
        protected IReadOnlyList <MatchResult> FindPackages(
            CompositeSearchBehavior behavior,
            uint limit)
        {
            PackageCatalog      catalog = this.GetPackageCatalog(behavior);
            FindPackagesOptions options = this.GetFindPackagesOptions(limit);

            return(GetMatchResults(catalog, options));
        }
Exemplo n.º 2
0
        private PackageCatalogReference GetPackageCatalogReference(CompositeSearchBehavior behavior)
        {
            CreateCompositePackageCatalogOptions    options    = ComObjectFactory.Value.CreateCreateCompositePackageCatalogOptions();
            IReadOnlyList <PackageCatalogReference> references = GetPackageCatalogReferences(this.Source);

            for (var i = 0; i < references.Count; i++)
            {
                options.Catalogs.Add(references[i]);
            }

            options.CompositeSearchBehavior = behavior;
            return(PackageManager.Value.CreateCompositePackageCatalog(options));
        }
Exemplo n.º 3
0
        private PackageCatalog GetPackageCatalog(CompositeSearchBehavior behavior)
        {
            PackageCatalogReference reference = this.GetPackageCatalogReference(behavior);
            ConnectResult           result    = reference.Connect();

            if (result.Status == ConnectResultStatus.Ok)
            {
                return(result.PackageCatalog);
            }
            else
            {
                throw new RuntimeException(Utilities.ResourceManager.GetString("RuntimeExceptionCatalogError"));
            }
        }
 /// <summary>
 /// Searches for packages from configured sources.
 /// </summary>
 /// <param name="behavior">A <see cref="CompositeSearchBehavior" /> value.</param>
 /// <returns>A list of <see cref="MatchResult" /> objects.</returns>
 protected IReadOnlyList <MatchResult> FindPackages(CompositeSearchBehavior behavior)
 {
     return(this.FindPackages(behavior, this.Count));
 }