Пример #1
0
        internal void UpdatePackageStatus()
        {
            if (ShowInstalled || ShowUpdatesAvailable)
            {
                // refresh the whole package list
                SearchPackageInActivePackageSource(_windowSearchHost.SearchQuery.SearchString);
            }
            else
            {
                // in this case, we only need to update PackageStatus of
                // existing items in the package list
                foreach (var item in _packageList.Items)
                {
                    var package = item as SearchResultPackageMetadata;
                    if (package == null)
                    {
                        continue;
                    }

                    package.Status = PackageManagerControl.GetPackageStatus(
                        package.Id,
                        Model.Context.Projects,
                        package.Versions);
                }
            }
        }
Пример #2
0
 private void CleanUp()
 {
     if (_content != null)
     {
         _content.CleanUp();
         _content = null;
     }
 }
 private void CleanUp()
 {
     if (_content != null)
     {
         _content.CleanUp();
         _content = null;
     }
 }
Пример #4
0
 public NuGetPackageManagerControlSearchTask(PackageManagerControl packageManagerControl, uint id, IVsSearchQuery pSearchQuery, IVsSearchCallback pSearchCallback)
 {
     _packageManagerControl = packageManagerControl;
     _searchCallback        = pSearchCallback;
     _searchQuery           = pSearchQuery;
     Id        = id;
     ErrorCode = 0;
     SetStatus(VsSearchTaskStatus.Created);
 }
Пример #5
0
        public void RefreshPackageStatus()
        {
            if (PackageManagerControl != null)
            {
                UIDispatcher.Invoke(() =>
                {
                    PackageManagerControl.UpdatePackageStatus();
                });
            }

            if (DetailControl != null)
            {
                UIDispatcher.Invoke(() =>
                {
                    DetailControl.Refresh();
                });
            }
        }
        public int OnClose(ref uint pgrfSaveOptions)
        {
            PackageManagerControl content = _content;

            if (content != null)
            {
                NuGetUIThreadHelper.JoinableTaskFactory.Run(async() =>
                {
                    await content.SaveSettingsAsync(CancellationToken.None);
                });

                content.Model.Context.UserSettingsManager.PersistSettings();
            }

            Closed?.Invoke(this, EventArgs.Empty);

            pgrfSaveOptions = (uint)__FRAMECLOSE.FRAMECLOSE_NoSave;

            Dispose();

            return(VSConstants.S_OK);
        }
        private void CreatePackageManagerControl()
        {
            _container = Initialize();

            this.Title = "NuGet Standalone UI";
            Height = 800;
            Width = 1000;
            
            var repositoryProvider = new SourceRepositoryProvider(_settings, Repository.Provider.GetVisualStudio());
            var settings = new DefaultSettings();

            var testSolutionManager = new TestSolutionManager(@"c:\temp\test");
            
            var projectA = testSolutionManager.AddNewMSBuildProject("projectA");
            var projectB = testSolutionManager.AddNewMSBuildProject("projectB");
            //var projectC = testSolutionManager.AddProjectKProject("projectK");

            var projects = new NuGetProject[] { projectA, projectB };            

            var packageRestoreManager = new PackageRestoreManager(repositoryProvider, settings, testSolutionManager);
            var contextFactory = new StandaloneUIContextFactory(
                repositoryProvider, 
                testSolutionManager, 
                settings, 
                packageRestoreManager: packageRestoreManager,
                optionsPage: null);
            var context = contextFactory.Create(@"c:\temp\test\settings.txt", projects);
            var uiController = _uiServiceFactory.Create(
                context,
                new NuGetUIProjectContext(new StandaloneUILogger(_textBox, _scrollViewer), _sourceControlManagerProvider, _commonOperations));

            PackageManagerModel model = new PackageManagerModel(uiController, context);
            model.SolutionName = "test solution";
            _packageManagerControl = new PackageManagerControl(model, _settings);
            layoutGrid.Children.Add(_packageManagerControl);
        }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the EditorPane class.
 /// </summary>
 public PackageManagerToolWindowPane(PackageManagerControl control, string projectGuid)
     : base(null)
 {
     _content    = control;
     ProjectGuid = projectGuid;
 }
 /// <summary>
 /// Initializes a new instance of the EditorPane class.
 /// </summary>
 public PackageManagerWindowPane(PackageManagerControl control)
     : base(null)
 {
     _content = control;
 }
 public void SetupSearch(IVsWindowSearch pWindowSearch)
 {
     _control = pWindowSearch as PackageManagerControl;
 }
 /// <summary>
 /// Initializes a new instance of the EditorPane class.
 /// </summary>
 public PackageManagerWindowPane(PackageManagerControl control)
     : base(null)
 {
     _content = control;
 }
 public void SetupSearch(IVsWindowSearch pWindowSearch)
 {
     _control = pWindowSearch as PackageManagerControl;
 }