private void SetNamespaceObjects() { var types = Inspector.GetAllTypesWithStaticPropertiesForAssemblyNamespace(Assembly, Namespace); foreach (var type in types) { var typeContainer = new Container("type"); var typeLabel = new Label(type.Name); typeLabel.AddToClassList("typename"); typeContainer.Add(typeLabel); var propertiesContainer = new Container("typeProperties"); foreach (var property in Inspector.GetAllStaticInstancesForType(type)) { var propertyLabel = new Label(property.Label); propertyLabel.AddClasses("propertyLabel"); propertyLabel.RegisterCallback <MouseDownEvent>(evt => OnPropertyClick(property)); propertiesContainer.Add(propertyLabel); } typeContainer.Add(propertiesContainer); ObjectContainer.Add(typeContainer); } }
private void SetError(string message, PackageState state) { switch (state) { case PackageState.Error: m_ErrorStatus.AddClasses("error"); break; case PackageState.Warning: m_ErrorStatus.AddClasses("warning"); break; default: break; } m_ErrorMessage.text = message; UIUtils.SetElementDisplay(this, true); }
public PackageDetailsTabView() { m_HeaderContainer.name = "packageDetailsTabViewHeaderContainer"; m_BodyContainer.name = "packageDetailsTabViewBodyContainer"; m_EntitlementsErrorLabel = new Label(L10n.Tr("Information is unavailable because the package license isn't registered to your user account.")); m_EntitlementsErrorLabel.AddClasses("packageTabsEntitlementsError"); Add(m_EntitlementsErrorLabel); }
public ExtendedExpandable(string label = "", VisualElement expandedView = null, VisualElement collapsedView = null, bool expanded = false, string classnames = "", string labelClassNames = "") : this() { this.AddClasses(classnames); Label.AddClasses(labelClassNames); Label.text = label; if (expandedView != null) { ExpandedView = expandedView; } if (collapsedView != null) { CollapsedView = collapsedView; } Expanded = expanded; }
public ClassView(object obj, ViewContext context) { var viewFull = new Label(); viewFull.AddClasses("icon node1 viewFull"); var views = new Container("viewModes"); Content = new ExtendedExpandable(); Content.Tools.Add(views); Add(Content); PinnedItem = new Span(); PinnedItem.name = "pinned-symbol"; PinnedItem.RegisterCallback <TooltipEvent>(e => { e.rect = PinnedItem.worldBound; e.tooltip = string.Format("Use {0} to refer to this element", PinnedSymbol); e.StopImmediatePropagation(); }); SetObject(obj, context); Content.OnExpandStateChanged += OnExpandState; }