Ejemplo n.º 1
0
        private void PopulateLicenses(ScrollContainer licensesList)
        {
            var margin = new MarginContainer {
                MarginLeftOverride = 2, MarginTopOverride = 2
            };
            var vBox = new VBoxContainer();

            margin.AddChild(vBox);

            foreach (var entry in CreditsManager.GetLicenses().OrderBy(p => p.Name))
            {
                vBox.AddChild(new Label {
                    StyleClasses = { StyleBase.StyleClassLabelHeading }, Text = entry.Name
                });

                // We split these line by line because otherwise
                // the LGPL causes Clyde to go out of bounds in the rendering code.
                foreach (var line in entry.License.Split("\n"))
                {
                    vBox.AddChild(new Label {
                        Text = line, FontColorOverride = new Color(200, 200, 200)
                    });
                }
            }

            licensesList.AddChild(margin);
        }