Beispiel #1
0
        bool CanConsolidate(ManageProjectViewModel projectViewModel, ManagePackagesSearchResultViewModel packageViewModel)
        {
            if (!projectViewModel.IsChecked)
            {
                return(false);
            }

            if (IsPackageInstalledInProjectWithSameVersion(
                    projectViewModel.ProjectInfo,
                    packageViewModel.Id,
                    packageViewModel.SelectedVersion))
            {
                return(false);
            }

            return(true);
        }
Beispiel #2
0
        void OnSelectedPackageChanged()
        {
            if (!IsConsolidatePageSelected)
            {
                return;
            }

            ProjectViewModels.Clear();

            if (SelectedPackage == null)
            {
                return;
            }

            List <ManageProjectViewModel> projectViewModels;

            if (!cachedProjectViewModels.TryGetValue(SelectedPackage.Id, out projectViewModels))
            {
                projectViewModels = new List <ManageProjectViewModel> ();
                var uncheckedProjectViewModels = new List <ManageProjectViewModel> ();
                foreach (ManagePackagesProjectInfo projectInfo in projectInformation)
                {
                    var projectViewModel = new ManageProjectViewModel(projectInfo, SelectedPackage.Id);
                    if (projectViewModel.IsChecked)
                    {
                        projectViewModels.Add(projectViewModel);
                    }
                    else
                    {
                        uncheckedProjectViewModels.Add(projectViewModel);
                    }
                }
                // Show projects that have the package installed before the other projects.
                projectViewModels.AddRange(uncheckedProjectViewModels);

                cachedProjectViewModels [SelectedPackage.Id] = projectViewModels;
            }

            foreach (ManageProjectViewModel projectViewModel in projectViewModels)
            {
                ProjectViewModels.Add(projectViewModel);
            }
        }
Beispiel #3
0
        void ProjectCheckBoxCellViewToggled(object sender, WidgetEventArgs e)
        {
            int row = projectsListView.CurrentEventRow;

            if (row == -1)
            {
                return;
            }

            ManageProjectViewModel selectedProject = projectStore.GetValue(row, projectField);

            if (selectedProject == null)
            {
                return;
            }

            selectedProject.IsChecked = !selectedProject.IsChecked;

            UpdateAddPackagesButton();
        }