void ShowPackageInformation(ManagePackagesSearchResultViewModel packageViewModel)
        {
            this.packageNameLabel.Markup   = packageViewModel.GetNameMarkup();
            this.packageAuthor.Text        = packageViewModel.Author;
            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);

            PopulatePackageDependencies(packageViewModel);

            PopulatePackageVersions(packageViewModel);

            this.packageInfoVBox.Visible     = true;
            this.packageVersionsHBox.Visible = true;

            packageViewModel.PropertyChanged += SelectedPackageViewModelChanged;
            viewModel.LoadPackageMetadata(packageViewModel);
        }
Exemple #2
0
        void ShowPackageInformation(ManagePackagesSearchResultViewModel packageViewModel)
        {
            bool consolidate = viewModel.IsConsolidatePageSelected;

            if (consolidate)
            {
                projectsListViewLabel.Text = GettextCatalog.GetString("Select projects and a version for a consolidation.");
            }
            else
            {
                // Use the package id and not the package title to prevent a pango crash if the title
                // contains Chinese characters.
                this.packageNameLabel.Markup   = packageViewModel.GetIdMarkup();
                this.packageAuthor.Text        = packageViewModel.Author;
                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);

                PopulatePackageDependencies(packageViewModel);
            }

            if (viewModel.IsInstalledPageSelected)
            {
                packageVersionsLabel.WidthRequest = -1;
                currentPackageVersionHBox.Visible = false;
                packageVersionsHBox.Visible       = false;
            }
            else if (viewModel.IsUpdatesPageSelected)
            {
                PopulatePackageVersions(packageViewModel);
                ShowCurrentPackageVersion(packageViewModel);
                packageVersionsHBox.Visible = true;
            }
            else
            {
                packageVersionsLabel.WidthRequest = -1;
                currentPackageVersionHBox.Visible = false;
                PopulatePackageVersions(packageViewModel);
                packageVersionsHBox.Visible = true;
            }

            foreach (Widget child in packageInfoVBox.Children)
            {
                child.Visible = !consolidate;
            }

            if (consolidate)
            {
                PopulateProjectList();
            }
            else
            {
                projectStore?.Clear();
            }

            projectsListViewLabel.Visible = consolidate;
            projectsListViewVBox.Visible  = consolidate;
            this.packageInfoVBox.Visible  = true;

            packageViewModel.PropertyChanged += SelectedPackageViewModelChanged;
            viewModel.LoadPackageMetadata(packageViewModel);
        }