Ejemplo n.º 1
0
        public NuGetSearchTask(NuGetSearchProvider provider, uint cookie, IVsSearchQuery searchQuery, IVsSearchProviderCallback searchCallback, OleMenuCommand managePackageDialogCommand, OleMenuCommand managePackageForSolutionDialogCommand)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            if (searchQuery == null)
            {
                throw new ArgumentNullException("searchQuery");
            }
            if (searchCallback == null)
            {
                throw new ArgumentNullException("searchCallback");
            }
            if (managePackageDialogCommand == null)
            {
                throw new ArgumentNullException("managePackageDialogCommand");
            }
            if (managePackageForSolutionDialogCommand == null)
            {
                throw new ArgumentNullException("managePackageForSolutionDialogCommand");
            }
            _provider                              = provider;
            _searchCallback                        = searchCallback;
            _managePackageDialogCommand            = managePackageDialogCommand;
            _managePackageForSolutionDialogCommand = managePackageForSolutionDialogCommand;

            SearchQuery = searchQuery;
            Id          = cookie;
            ErrorCode   = 0;

            SetStatus(VsSearchTaskStatus.Created);
        }
Ejemplo n.º 2
0
        public NuGetStaticSearchResult(string searchText, NuGetSearchProvider provider, OleMenuCommand supportedManagePackageCommand)
        {
            if (searchText == null)
            {
                throw new ArgumentNullException("searchText");
            }
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            if (supportedManagePackageCommand == null)
            {
                throw new ArgumentNullException("supportedManagePackageCommand");
            }

            if (searchText.StartsWith(provider.Shortcut + " "))
            {
                searchText = searchText.Substring(provider.Shortcut.Length);
            }

            _searchText = searchText;
            _supportedManagePackageCommand = supportedManagePackageCommand;

            DisplayText = String.Format(CultureInfo.CurrentCulture,
                                        Resources.NuGetStaticResult_DisplayText, searchText);
            _searchProvider = provider;
        }
        public NuGetStaticSearchResult(string searchText, NuGetSearchProvider provider, OleMenuCommand supportedManagePackageCommand)
        {
            if (searchText == null)
            {
                throw new ArgumentNullException("searchText");
            }
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            if (supportedManagePackageCommand == null)
            {
                throw new ArgumentNullException("supportedManagePackageCommand");
            }

            _searchText = searchText;
            _supportedManagePackageCommand = supportedManagePackageCommand;

            DisplayText = String.Format(CultureInfo.CurrentCulture,
                Resources.NuGetStaticResult_DisplayText, searchText);
            _searchProvider = provider;
        }