public StreamingFindUsagesPresenter( IMSBuildEditorHost host, SVsServiceProvider serviceProvider, IEditorFormatMapService formatMapService, IClassificationFormatMapService classificationFormatMapService, IClassificationTypeRegistryService classificationTypeRegistry, [ImportMany] IEnumerable <Lazy <ITableColumnDefinition, NameMetadata> > columns) : this( host, serviceProvider, formatMapService, classificationFormatMapService, classificationTypeRegistry, columns.Where(c => c.Metadata.Name == FindUsagesValueUsageInfoColumnDefinition.ColumnName).Select(c => c.Value)) { }
private StreamingFindUsagesPresenter( IMSBuildEditorHost host, Microsoft.VisualStudio.Shell.SVsServiceProvider serviceProvider, IEditorFormatMapService formatMapService, IClassificationFormatMapService classificationFormatMapService, IClassificationTypeRegistryService classificationTypeRegistry, IEnumerable <ITableColumnDefinition> columns) { Host = host; _serviceProvider = serviceProvider; FormatMapService = formatMapService; ClassificationFormatMap = classificationFormatMapService.GetClassificationFormatMap("tooltip"); ClassificationTypeRegistry = classificationTypeRegistry; _vsFindAllReferencesService = serviceProvider.GetService <SVsFindAllReferences, IFindAllReferencesService> (true); _customColumns = columns.OfType <AbstractFindUsagesCustomColumnDefinition> ().ToImmutableArray(); }
void OpenNuGetUrl(string nuGetId, IMSBuildEditorHost host) { Task.Run(async() => { var results = await PackageSearchManager.SearchPackageInfo(nuGetId, null, null).ToTask(); if (results.Any(r => r.SourceKind == FeedKind.NuGet)) { var url = $"https://www.nuget.org/packages/{Uri.EscapeUriString (nuGetId)}"; Process.Start(url); } else { await JoinableTaskContext.Factory.SwitchToMainThreadAsync(); host.ShowStatusBarMessage("Package is not from NuGet.org"); } }); }