コード例 #1
0
        void ShowSelectedPackage()
        {
            PackageViewModel packageViewModel = GetSelectedPackageViewModel();

            if (packageViewModel != null)
            {
                ShowPackageInformation(packageViewModel);
            }
            else
            {
                ClearSelectedPackageInformation();
            }
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        bool OlderPackageInstalledThanPackageSelected()
        {
            if (PackagesCheckedCount != 0)
            {
                return(false);
            }

            PackageViewModel selectedPackageViewModel = GetSelectedPackageViewModel();

            if (selectedPackageViewModel != null)
            {
                return(selectedPackageViewModel.IsOlderPackageInstalled());
            }
            return(false);
        }
コード例 #7
0
        void PackageSearchEntryActivated(object sender, EventArgs e)
        {
            if (loadingMessageVisible)
            {
                return;
            }

            if (PackagesCheckedCount > 0)
            {
                AddPackagesButtonClicked(sender, e);
            }
            else
            {
                PackageViewModel selectedPackageViewModel = GetSelectedPackageViewModel();
                InstallPackage(selectedPackageViewModel);
            }
        }
コード例 #8
0
        public void OnPackageCheckedChanged(PackageViewModel packageViewModel)
        {
            if (ignorePackageCheckedChanged)
            {
                return;
            }

            if (packageViewModel.IsChecked)
            {
                UncheckExistingCheckedPackageWithDifferentVersion(packageViewModel);
                CheckedPackageViewModels.Add(packageViewModel);
            }
            else
            {
                CheckedPackageViewModels.Remove(packageViewModel);
            }
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        void PackageSearchEntryActivated(object sender, EventArgs e)
        {
            if (loadingMessageVisible)
            {
                return;
            }

            if (PackagesCheckedCount > 0)
            {
                AddPackagesButtonClicked(sender, e);
            }
            else
            {
                PackageViewModel selectedPackageViewModel = GetSelectedPackageViewModel();
                packagesToAdd = GetPackagesToAdd(new [] { selectedPackageViewModel });
                Close();
            }
        }
コード例 #11
0
        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;
        }
コード例 #12
0
        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);
            }
        }
コード例 #13
0
        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();
            }
        }
コード例 #14
0
        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;
        }
コード例 #15
0
        void ManagePackagesButtonClicked(object sender, EventArgs e)
        {
            PackageViewModel packageViewModel = GetSelectedPackageViewModel();

            packageViewModel.ManagePackage();
        }
 public PackageCellViewEventArgs(PackageViewModel packageViewModel)
 {
     PackageViewModel = packageViewModel;
 }
コード例 #17
0
        void PackageSearchEntryActivated(object sender, EventArgs e)
        {
            PackageViewModel selectedPackageViewModel = GetSelectedPackageViewModel();

            InstallPackage(selectedPackageViewModel);
        }