Beispiel #1
0
        void UncheckExistingCheckedPackageWithDifferentVersion(ManagePackagesSearchResultViewModel packageViewModel)
        {
            ManagePackagesSearchResultViewModel existingPackageViewModel = GetExistingCheckedPackageViewModel(packageViewModel.Id);

            if (existingPackageViewModel != null)
            {
                CheckedPackageViewModels.Remove(existingPackageViewModel);
                existingPackageViewModel.IsChecked = false;
            }
        }
Beispiel #2
0
 void UpdatePackageViewModelIfPreviouslyChecked(ManagePackagesSearchResultViewModel packageViewModel)
 {
     ignorePackageCheckedChanged = true;
     try {
         ManagePackagesSearchResultViewModel existingPackageViewModel = GetExistingCheckedPackageViewModel(packageViewModel.Id);
         if (existingPackageViewModel != null)
         {
             packageViewModel.UpdateFromPreviouslyCheckedViewModel(existingPackageViewModel);
             CheckedPackageViewModels.Remove(existingPackageViewModel);
             CheckedPackageViewModels.Add(packageViewModel);
         }
     } finally {
         ignorePackageCheckedChanged = false;
     }
 }
Beispiel #3
0
        public void OnPackageCheckedChanged(ManagePackagesSearchResultViewModel packageViewModel)
        {
            if (ignorePackageCheckedChanged)
            {
                return;
            }

            if (packageViewModel.IsChecked)
            {
                UncheckExistingCheckedPackageWithDifferentVersion(packageViewModel);
                CheckedPackageViewModels.Add(packageViewModel);
            }
            else
            {
                CheckedPackageViewModels.Remove(packageViewModel);
            }
        }
Beispiel #4
0
        void UpdateRecentPackages()
        {
            if (SelectedPackageSource == null)
            {
                return;
            }

            if (CheckedPackageViewModels.Any())
            {
                foreach (ManagePackagesSearchResultViewModel packageViewModel in CheckedPackageViewModels)
                {
                    recentPackagesRepository.AddPackage(packageViewModel, SelectedPackageSource.Name);
                }
            }
            else
            {
                recentPackagesRepository.AddPackage(SelectedPackage, SelectedPackageSource.Name);
            }
        }
Beispiel #5
0
 ManagePackagesSearchResultViewModel GetExistingCheckedPackageViewModel(string packageId)
 {
     return(CheckedPackageViewModels
            .FirstOrDefault(item => item.Id == packageId));
 }