public static string GetDisplayName(this VisualElement ve, bool withHashCode = true)
        {
            bool   flag = ve == null;
            string result;

            if (flag)
            {
                result = string.Empty;
            }
            else
            {
                string text  = ve.GetType().Name;
                bool   flag2 = !string.IsNullOrEmpty(ve.name);
                if (flag2)
                {
                    text = text + "#" + ve.name;
                }
                if (withHashCode)
                {
                    text = text + " (" + ve.GetHashCode().ToString("x8") + ")";
                }
                result = text;
            }
            return(result);
        }
Ejemplo n.º 2
0
        private void OnAttachToPanel(AttachToPanelEvent evt)
        {
            int num = 0;

            for (int i = 0; i <= Foldout.ussFoldoutMaxDepth; i++)
            {
                base.RemoveFromClassList(Foldout.ussFoldoutDepthClassName + i.ToString());
            }
            base.RemoveFromClassList(Foldout.ussFoldoutDepthClassName + "max");
            bool flag = base.parent != null;

            if (flag)
            {
                for (VisualElement parent = base.parent; parent != null; parent = parent.parent)
                {
                    bool flag2 = parent.GetType() == typeof(Foldout);
                    if (flag2)
                    {
                        num++;
                    }
                }
            }
            bool flag3 = num > Foldout.ussFoldoutMaxDepth;

            if (flag3)
            {
                base.AddToClassList(Foldout.ussFoldoutDepthClassName + "max");
            }
            else
            {
                base.AddToClassList(Foldout.ussFoldoutDepthClassName + num.ToString());
            }
        }