コード例 #1
0
        public BaseTabView()
        {
            m_HeaderContainer = new VisualElement();
            m_HeaderContainer.AddClasses("tabsHeaderContainer container row");
            m_BodyContainer = new VisualElement();
            m_BodyContainer.AddClasses("tabsBodyContainer");

            m_HeaderButtons = new Dictionary <string, Button>();
            m_TabElements   = new Dictionary <string, T>();

            Add(m_HeaderContainer);
            Add(m_BodyContainer);
        }
コード例 #2
0
        public NamespaceInspector(string ns, Assembly assembly)
        {
            Assembly  = assembly;
            Namespace = ns;
            AddToClassList("namespace");

            Label = new Label(ns);
            Label.AddToClassList("namespace-label");
            Add(Label);

            ObjectContainer = new VisualElement();
            ObjectContainer.AddClasses("object-container");
            Add(ObjectContainer);

            Label.RegisterCallback <MouseDownEvent>(OnClick);
            tooltip = $"Click to have namespace {ns} be used in your current context";
        }
コード例 #3
0
        private void SwitchToRegularSampleList()
        {
            UIUtils.SetElementDisplay(samplesListLowWidth, false);
            UIUtils.SetElementDisplay(samplesContainer, true);

            samplesContainer.Clear();

            foreach (var sample in m_Samples.Where(s => !string.IsNullOrEmpty(s.displayName)))
            {
                var sampleItem      = new PackageSampleItem(m_Version, sample);
                var sampleContainer = new VisualElement();
                sampleContainer.AddClasses("sampleContainer");

                var importStatus = new VisualElement();
                importStatus.name = "importStatusContainer";
                importStatus.Add(sampleItem.importStatus);

                var nameAndSizeLabel = new VisualElement();
                nameAndSizeLabel.name = "nameAndSizeLabelContainer";
                nameAndSizeLabel.Add(sampleItem.nameLabel);
                nameAndSizeLabel.Add(sampleItem.sizeLabel);
                nameAndSizeLabel.Add(importStatus);
                sampleContainer.Add(nameAndSizeLabel);

                var importButton = new VisualElement();
                importButton.name = "importButtonContainer";
                importButton.Add(sampleItem.importButton);
                sampleContainer.Add(importButton);

                if (!string.IsNullOrEmpty(sample.description))
                {
                    var description = new VisualElement();
                    description.name = "descriptionContainer";
                    description.Add(sampleItem.descriptionLabel);
                    sampleContainer.Add(description);
                }


                samplesContainer.Add(sampleContainer);

                sampleItem.importButton.SetEnabled(m_Version.isInstalled);
            }
        }