コード例 #1
0
 public PackageVersionSearchCompletionDataList(IPackageSearchManager searchManager, string tfm, string packageId)
 {
     this.searchManager = searchManager;
     this.tfm           = tfm;
     this.packageId     = packageId;
     StartSearch();
 }
コード例 #2
0
 public PackageCompletionSource(ITextBuffer textBuffer, ICompletionBroker completionBroker, IClassifierAggregatorService classifier, IPackageSearchManager searchManager)
 {
     _classifier       = classifier.GetClassifier(textBuffer);
     _searchManager    = searchManager;
     _textBuffer       = textBuffer;
     _completionBroker = completionBroker;
     textBuffer.Properties.AddProperty(typeof(PackageCompletionSource), this);
 }
コード例 #3
0
 public PackageSearchCompletionData(
     IPackageSearchManager manager, string name,
     string packageId, string packageVersion, string tfm)
     : base(name, Stock.Reference)
 {
     this.manager        = manager;
     this.packageId      = packageId;
     this.packageVersion = packageVersion;
     this.tfm            = tfm;
 }
コード例 #4
0
 public PackageInfoControl(string packageId, string version, string tfm, IPackageSearchManager searcher)
 {
     InitializeComponent();
     PackageId.Content  = packageId;
     Glyph.Source       = WpfUtil.MonikerToBitmap(KnownMonikers.NuGet, 32);
     Glyph.ImageFailed += OnImageFailed;
     _job          = searcher.SearchPackageInfo(packageId, version, tfm);
     _job.Updated += JobUpdated;
     _firstRun     = true;
     JobUpdated(null, EventArgs.Empty);
 }
コード例 #5
0
        private PackageCompletionSource(ITextBuffer textBuffer, ICompletionBroker completionBroker, IClassifierAggregatorService classifier, IPackageSearchManager searchManager)
        {
            _classifier       = classifier.GetClassifier(textBuffer);
            _searchManager    = searchManager;
            _textBuffer       = textBuffer;
            _completionBroker = completionBroker;

            if (textBuffer.Properties.ContainsProperty(typeof(PackageCompletionSource)))
            {
                textBuffer.Properties.RemoveProperty(typeof(PackageCompletionSource));
            }

            textBuffer.Properties.AddProperty(typeof(PackageCompletionSource), this);
        }
コード例 #6
0
        protected override void Initialize()
        {
            base.Initialize();

            //we don't have a MEF composition here, set it up manually
            PackageSearchManager = new PackageSearchManager(
                new MonoDevelopPackageFeedRegistry(),
                new PackageFeedFactorySelector(new IPackageFeedFactory [] {
                new NuGetDiskFeedFactory(new FileSystem()),
                new NuGetV3ServiceFeedFactory(new WebRequestFactory()),
            })
                );

            CheckHighlighting();
        }
コード例 #7
0
        public static Task <IReadOnlyList <IPackageInfo> > SearchPackageInfo(
            this IPackageSearchManager manager,
            string packageId, string packageVersion, string tfm,
            CancellationToken cancelToken)
        {
            var search = manager.SearchPackageInfo(packageId, packageVersion, tfm);

            if (search.RemainingFeeds.Count == 0)
            {
                return(Task.FromResult(search.Results));
            }

            var tcs = new TaskCompletionSource <IReadOnlyList <IPackageInfo> > ();

            //making sure we actually unregister the eventhandler is kinda tricky
            //it could be already completed, or it could complete after we check but before we register
            EventHandler handleSearchUpdated = null;

            cancelToken.Register(() => {
                search.Cancel();
                if (tcs.TrySetCanceled())
                {
                    search.Updated -= handleSearchUpdated;
                }
            });

            handleSearchUpdated = (s, a) => {
                if (!cancelToken.IsCancellationRequested && search.RemainingFeeds.Count == 0)
                {
                    if (tcs.TrySetResult(search.Results))
                    {
                        search.Updated -= handleSearchUpdated;
                    }
                }
            };
            search.Updated += handleSearchUpdated;

            if (search.RemainingFeeds.Count == 0)
            {
                handleSearchUpdated(search, EventArgs.Empty);
            }

            return(tcs.Task);
        }
コード例 #8
0
 public PackageIntellisenseControllerProvider(ICompletionBroker completionBroker, IPackageSearchManager searchManager)
 {
     CompletionBroker = completionBroker;
     _searchManager   = searchManager;
 }
コード例 #9
0
 public PackageQuickInfoSource(IPackageSearchManager searchManager)
 {
     _searchManager = searchManager;
 }
コード例 #10
0
 public PackageQuickInfoProvider(IPackageSearchManager searchManager)
 {
     _searchManager = searchManager;
 }
コード例 #11
0
 public MsBuildPropertyQuickInfoSource(IWorkspaceManager workspaceManager, IPackageSearchManager searchManager)
 {
     _searchManager    = searchManager;
     _workspaceManager = workspaceManager;
 }
コード例 #12
0
 public PackageCompletionSourceProvider(ICompletionBroker completionBroker, IPackageSearchManager searchManager, IClassifierAggregatorService classifier)
 {
     _classifier       = classifier;
     _completionBroker = completionBroker;
     _searchManager    = searchManager;
 }
コード例 #13
0
 public PackageNameSearchCompletionDataList(string initialSearch, IPackageSearchManager searchManager, string tfm)
 {
     this.searchManager = searchManager;
     this.tfm           = tfm;
     StartSearch(initialSearch);
 }
コード例 #14
0
 public CompletionTooltipElementProvider(IPackageSearchManager searcher)
 {
     _searcher = searcher;
 }
コード例 #15
0
        public static PackageCompletionSource GetOrAddCompletionSource(ITextBuffer textBuffer, ICompletionBroker completionBroker, IClassifierAggregatorService classifier, IPackageSearchManager searchManager)
        {
            if (textBuffer.Properties.TryGetProperty(typeof(PackageCompletionSource), out PackageCompletionSource source))
            {
                return(source);
            }

            return(new PackageCompletionSource(textBuffer, completionBroker, classifier, searchManager));
        }
コード例 #16
0
 public DotnetCliToolReferenceGlyphTaggerProvider(IPackageSearchManager searchManager)
 {
     _searchManager = searchManager;
 }
コード例 #17
0
 public QuickInfoProvider(IWorkspaceManager workspaceManager, IPackageSearchManager searchManager)
 {
     _searchManager    = searchManager;
     _workspaceManager = workspaceManager;
 }
コード例 #18
0
 public PackageGlyphTagFactory(IPackageSearchManager searchManager)
 {
     _searchManager = searchManager;
 }
コード例 #19
0
 public PackageReferenceGlyphTaggerProvider(IPackageSearchManager searchManager)
 {
     _searchManager = searchManager;
 }