コード例 #1
0
 void LoadPackageImage(int row, PackageSearchResultViewModel packageViewModel)
 {
     if (packageViewModel.HasIconUrl)
     {
         imageLoader.LoadFrom(packageViewModel.IconUrl, row);
     }
 }
コード例 #2
0
        void AddPackage(PackageLicenseViewModel package)
        {
            var titleBox = new VBox();

            titleBox.Spacing      = 0;
            titleBox.MarginBottom = 4;
            titleBox.PackStart(new Label {
                Markup = string.Format("<span weight='bold'>{0}</span> – {1}", package.Id, package.Author),
            });
            var licenseLabel = new LinkLabel(GettextCatalog.GetString("View License"));

            licenseLabel.Uri          = package.LicenseUrl;
            licenseLabel.LinkClicked += (sender, e) => IdeServices.DesktopService.ShowUrl(e.Target.AbsoluteUri);
            titleBox.PackStart(licenseLabel);

            var rowBox = new HBox();

            rowBox.Margin = rowMargin;

            var icon = new ImageView(ImageService.GetIcon("md-package", Gtk.IconSize.Dnd));

            if (package.IconUrl != null && !string.IsNullOrEmpty(package.IconUrl.AbsoluteUri))
            {
                imageLoader.LoadFrom(package.IconUrl, icon);
            }

            rowBox.PackStart(icon);
            rowBox.PackStart(titleBox, true);

            packagesList.PackStart(rowBox);
        }
コード例 #3
0
 void LoadImage(Uri iconUrl, int row)
 {
     // Put it back on the GUI thread so the correct synchronization context
     // is used. The image loading will be done on a background thread.
     Runtime.RunInMainThread(() => imageLoader.LoadFrom(iconUrl, row));
 }
コード例 #4
0
 void LoadImage(Uri iconUrl, int row)
 {
     // Put it back on the GUI thread so the correct synchronization context
     // is used. The image loading will be done on a background thread.
     DispatchService.GuiDispatch(() => imageLoader.LoadFrom(iconUrl, row));
 }