public override Task <bool> TryConfigure(IEngineEnvironmentSettings environmentSettings, IReadOnlyList <IInstallUnitDescriptor> existingInstallDescriptors)
        {
            IFileMetadataTemplateSearchCache      searchCache = CreateSearchCache(environmentSettings);
            NupkgHigherVersionInstalledPackFilter packFilter  = new NupkgHigherVersionInstalledPackFilter(existingInstallDescriptors);

            Configure(searchCache, packFilter);

            return(Task.FromResult(true));
        }
Ejemplo n.º 2
0
        public async override Task <bool> TryConfigure(IEngineEnvironmentSettings environmentSettings, IReadOnlyList <IManagedTemplatePackage> existingTemplatePackages)
        {
            string searchMetadataFileLocation = Path.Combine(environmentSettings.Paths.HostVersionSettingsDir, _templateDiscoveryMetadataFile);

            if (!await _searchInfoFileProvider.TryEnsureSearchFileAsync(environmentSettings, searchMetadataFileLocation).ConfigureAwait(false))
            {
                return(false);
            }

            IFileMetadataTemplateSearchCache      searchCache = CreateSearchCache(environmentSettings);
            NupkgHigherVersionInstalledPackFilter packFilter  = new NupkgHigherVersionInstalledPackFilter(existingTemplatePackages);

            Configure(searchCache, packFilter);

            return(true);
        }
        public async override Task <bool> TryConfigure(IEngineEnvironmentSettings environmentSettings, IReadOnlyList <IInstallUnitDescriptor> existingInstallDescriptors)
        {
            Paths  paths = new Paths(environmentSettings);
            string searchMetadataFileLocation = Path.Combine(paths.User.BaseDir, _templateDiscoveryMetadataFile);

            if (!await _searchInfoFileProvider.TryEnsureSearchFileAsync(environmentSettings, paths, searchMetadataFileLocation))
            {
                return(false);
            }

            IFileMetadataTemplateSearchCache      searchCache = CreateSearchCache(environmentSettings);
            NupkgHigherVersionInstalledPackFilter packFilter  = new NupkgHigherVersionInstalledPackFilter(existingInstallDescriptors);

            Configure(searchCache, packFilter);

            return(true);
        }
 protected void Configure(IFileMetadataTemplateSearchCache searchCache, ISearchPackFilter packFilter)
 {
     SearchCache = searchCache;
     _packFilter = packFilter;
 }