void AddPackage(PackageLicenseViewModel package)
        {
            var label = new Label()
            {
                Xalign = 0,
                Yalign = 0,
                Xpad   = 5,
                Ypad   = 5,
                Wrap   = true,
                Markup = CreatePackageMarkup(package)
            };

            GtkWorkarounds.SetLinkHandler(label, DesktopService.ShowUrl);

            this.packagesVBox.PackStart(label, false, false, 0);
        }
Exemplo n.º 2
0
        void Build()
        {
            Spacing = 6;

            PackStart(new Label {
                Markup = string.Format("<b>{0}</b>", GettextCatalog.GetString("Target Framework")), Xalign = 0f
            });

            var fxAlignment = new Alignment(0f, 0f, 1f, 1f)
            {
                LeftPadding = 12
            };

            PackStart(fxAlignment);
            var radioBox = new VBox {
                Spacing = 10
            };

            fxAlignment.Add(radioBox);

            var netstandardPickerHbox = new HBox {
                Spacing = 10
            };

            radioBox.PackStart(netstandardPickerHbox);
            netstandardRadio = new RadioButton(GettextCatalog.GetString(".NET Standard Platform:"));
            netstandardPickerHbox.PackStart(netstandardRadio, false, false, 0);
            netstandardPickerHbox.PackStart(netStandardCombo = ComboBox.NewText(), false, false, 0);

            var netstandardDesc = new Label {
                Markup = GettextCatalog.GetString("Your library will be compatible with all frameworks that support the selected <a href='{0}'>.NET Standard</a> version.", netstandardDocsUrl), Xalign = 0f
            };

            GtkWorkarounds.SetLinkHandler(netstandardDesc, HandleLink);
            radioBox.PackStart(new Alignment(0f, 0f, 1f, 1f)
            {
                Child = netstandardDesc, LeftPadding = 24
            });

            var pclPickerHbox = new HBox {
                Spacing = 10
            };

            radioBox.PackStart(pclPickerHbox);
            pclRadio = new RadioButton(netstandardRadio, GettextCatalog.GetString(".NET Portable:"));
            pclPickerHbox.PackStart(pclRadio, false, false, 0);
            pclPickerHbox.PackStart(targetFrameworkEntry = new Entry {
                IsEditable = false, WidthChars = 20, Name = "targetFrameworkEntry"
            }, false, false, 0);
            frameworkPickerButton = new Button(GettextCatalog.GetString("Change..."));
            pclPickerHbox.PackStart(frameworkPickerButton, false, false, 0);

            var pclDesc = new Label {
                Markup = GettextCatalog.GetString("Your library will be compatible with the frameworks supported by the selected <a href='{0}'>PCL profile</a>.", pcldDocsUrl), Xalign = 0f
            };

            GtkWorkarounds.SetLinkHandler(pclDesc, HandleLink);
            radioBox.PackStart(new Alignment(0f, 0f, 1f, 1f)
            {
                Child = pclDesc, LeftPadding = 24
            });

            frameworkPickerButton.Clicked += PickFramework;

            // both toggle when we switch between them, only need to subscribe to one event
            netstandardRadio.Toggled += RadioToggled;

            netStandardCombo.Name = "netStandardCombo";

            ShowAll();
        }