void ShowSelectedPackage() { PackageViewModel packageViewModel = GetSelectedPackageViewModel(); if (packageViewModel != null) { ShowPackageInformation(packageViewModel); } else { ClearSelectedPackageInformation(); } }
void InstallPackage(PackageViewModel packageViewModel) { try { if (packageViewModel != null) { List <IPackageAction> packageActions = CreateInstallPackageActions(new PackageViewModel [] { packageViewModel }); InstallPackages(packageActions); } } catch (Exception ex) { LoggingService.LogError("Installing package failed.", ex); ShowErrorMessage(ex.Message); } }
void PackagesListRowActivated(object sender, ListViewRowEventArgs e) { if (PackagesCheckedCount > 0) { AddPackagesButtonClicked(sender, e); } else { PackageViewModel packageViewModel = packageStore.GetValue(e.RowIndex, packageViewModelField); packagesToAdd = GetPackagesToAdd(new [] { packageViewModel }); Close(); } }
void DrawCheckBox(Context ctx, PackageViewModel packageViewModel, Rectangle cellArea) { CreateCheckboxImages(); Image image = GetCheckBoxImage(packageViewModel.IsChecked); double alpha = GetCheckBoxImageAlpha(); ctx.DrawImage( image, cellArea.Left + checkBoxPadding.Left, cellArea.Top + ((cellArea.Height - checkBoxImageSize.Height - 2) / 2), alpha); }
List <PackageViewModel> GetCheckedPackageViewModels() { var packageViewModels = new List <PackageViewModel> (); for (int row = 0; row < viewModel.PackageViewModels.Count; ++row) { PackageViewModel packageViewModel = viewModel.PackageViewModels [row]; if (packageViewModel.IsChecked) { packageViewModels.Add(packageViewModel); } } return(packageViewModels); }
bool OlderPackageInstalledThanPackageSelected() { if (PackagesCheckedCount != 0) { return(false); } PackageViewModel selectedPackageViewModel = GetSelectedPackageViewModel(); if (selectedPackageViewModel != null) { return(selectedPackageViewModel.IsOlderPackageInstalled()); } return(false); }
void PackageSearchEntryActivated(object sender, EventArgs e) { if (loadingMessageVisible) { return; } if (PackagesCheckedCount > 0) { AddPackagesButtonClicked(sender, e); } else { PackageViewModel selectedPackageViewModel = GetSelectedPackageViewModel(); InstallPackage(selectedPackageViewModel); } }
public void OnPackageCheckedChanged(PackageViewModel packageViewModel) { if (ignorePackageCheckedChanged) { return; } if (packageViewModel.IsChecked) { UncheckExistingCheckedPackageWithDifferentVersion(packageViewModel); CheckedPackageViewModels.Add(packageViewModel); } else { CheckedPackageViewModels.Remove(packageViewModel); } }
List <PackageViewModel> GetSelectedPackageViewModels() { List <PackageViewModel> packageViewModels = viewModel.CheckedPackageViewModels.ToList(); if (packageViewModels.Count > 0) { return(packageViewModels); } PackageViewModel selectedPackageViewModel = GetSelectedPackageViewModel(); if (selectedPackageViewModel != null) { packageViewModels.Add(selectedPackageViewModel); } return(packageViewModels); }
void PackageSearchEntryActivated(object sender, EventArgs e) { if (loadingMessageVisible) { return; } if (PackagesCheckedCount > 0) { AddPackagesButtonClicked(sender, e); } else { PackageViewModel selectedPackageViewModel = GetSelectedPackageViewModel(); packagesToAdd = GetPackagesToAdd(new [] { selectedPackageViewModel }); Close(); } }
void ShowPackageInformation(PackageViewModel packageViewModel) { this.packageNameLabel.Markup = packageViewModel.GetNameMarkup(); this.packageVersionLabel.Text = packageViewModel.Version.ToString(); this.packageAuthor.Text = packageViewModel.GetAuthors(); this.packagePublishedDate.Text = packageViewModel.GetLastPublishedDisplayText(); this.packageDownloads.Text = packageViewModel.GetDownloadCountDisplayText(); this.packageDescription.Text = packageViewModel.Description; this.packageId.Text = packageViewModel.Id; this.packageId.Visible = packageViewModel.HasNoGalleryUrl; ShowUri(this.packageIdLink, packageViewModel.GalleryUrl, packageViewModel.Id); ShowUri(this.packageProjectPageLink, packageViewModel.ProjectUrl); ShowUri(this.packageLicenseLink, packageViewModel.LicenseUrl); this.packageDependenciesListHBox.Visible = packageViewModel.HasDependencies; this.packageDependenciesNoneLabel.Visible = !packageViewModel.HasDependencies; this.packageDependenciesList.Text = packageViewModel.GetPackageDependenciesDisplayText(); this.packageInfoVBox.Visible = true; }
protected override void OnButtonPressed(ButtonEventArgs args) { PackageViewModel packageViewModel = GetValue(PackageField); if (packageViewModel == null) { base.OnButtonPressed(args); return; } double x = args.X - Bounds.X; double y = args.Y - Bounds.Y; if (checkBoxImageClickableRectangle.Contains(x, y)) { packageViewModel.IsChecked = !packageViewModel.IsChecked; OnPackageChecked(packageViewModel); } }
void AppendPackagesToListView() { bool packagesListViewWasEmpty = (packageStore.RowCount == 0); for (int row = packageStore.RowCount; row < viewModel.PackageViewModels.Count; ++row) { PackageViewModel packageViewModel = viewModel.PackageViewModels [row]; AppendPackageToListView(packageViewModel); LoadPackageImage(row, packageViewModel); } if (packagesListViewWasEmpty && (packageStore.RowCount > 0)) { packagesListView.SelectRow(0); } if (!viewModel.IsReadingPackages && (packageStore.RowCount == 0)) { ShowNoPackagesFoundMessage(); } }
void ShowPackageInformation(PackageViewModel packageViewModel) { this.packageVersionTextBox.Text = packageViewModel.Version.ToString(); this.packageCreatedByTextBox.Text = packageViewModel.GetAuthors(); this.packageLastUpdatedTextBox.Text = packageViewModel.GetLastPublishedDisplayText(); this.packageDownloadsTextBox.Text = packageViewModel.GetDownloadCountDisplayText(); this.packageDescriptionTextView.Buffer.Text = packageViewModel.Description; this.packageIdTextBox.Text = packageViewModel.Id; this.packageIdTextBox.Visible = packageViewModel.HasNoGalleryUrl; ShowUri(this.packageIdButton, packageViewModel.GalleryUrl, packageViewModel.Id); ShowUri(this.moreInformationButton, packageViewModel.ProjectUrl); ShowUri(this.viewLicenseTermsButton, packageViewModel.LicenseUrl); this.packageDependenciesListHBox.Visible = packageViewModel.HasDependencies; this.packageDependenciesNoneLabel.Visible = !packageViewModel.HasDependencies; this.packageDependenciesListLabel.Text = packageViewModel.GetPackageDependenciesDisplayText(); EnablePackageActionButtons(packageViewModel); this.packageInfoFrameVBox.Visible = true; this.managePackageButtonBox.Visible = true; }
void ManagePackagesButtonClicked(object sender, EventArgs e) { PackageViewModel packageViewModel = GetSelectedPackageViewModel(); packageViewModel.ManagePackage(); }
public PackageCellViewEventArgs(PackageViewModel packageViewModel) { PackageViewModel = packageViewModel; }
void PackageSearchEntryActivated(object sender, EventArgs e) { PackageViewModel selectedPackageViewModel = GetSelectedPackageViewModel(); InstallPackage(selectedPackageViewModel); }