protected async Task EnsureSearchResultsAsync()
        {
            if (_isSearchPerformed)
            {
                return;
            }

            TemplateSearcher searcher = new TemplateSearcher(EnvironmentSettings, DefaultLanguage, MatchFilter);
            IReadOnlyList <IManagedTemplatePackage> existingTemplatePackage;

            existingTemplatePackage = (await EnvironmentSettings.SettingsLoader.TemplatePackagesManager.GetTemplatePackagesAsync(false).ConfigureAwait(false)).OfType <IManagedTemplatePackage>().ToList();

            SearchResults = await searcher.SearchForTemplatesAsync(existingTemplatePackage, InputTemplateName).ConfigureAwait(false);

            _isSearchPerformed = true;
        }
예제 #2
0
        protected async Task EnsureSearchResultsAsync()
        {
            if (_isSearchPerformed)
            {
                return;
            }

            TemplateSearcher searcher = new TemplateSearcher(_environmentSettings, _defaultLanguage, _matchFilter);
            IReadOnlyList <IInstallUnitDescriptor> existingInstallDescriptors;

            if (_environmentSettings.SettingsLoader is SettingsLoader settingsLoader)
            {
                existingInstallDescriptors = settingsLoader.InstallUnitDescriptorCache.Descriptors.Values.ToList();
            }
            else
            {
                existingInstallDescriptors = new List <IInstallUnitDescriptor>();
            }

            _searchResults = await searcher.SearchForTemplatesAsync(existingInstallDescriptors, _inputTemplateName);

            _isSearchPerformed = true;
        }