public TreeDataClassMemberNode(object parent, FieldOrProperty member, NodeAttributes attributes)
            : base(parent)
        {
            Name     = member.GetName();
            TypeName = member.GetMemberType().GetFriendlyName();

            ParentFieldEntry = member;
            AllowEdits       = !attributes.HasFlag(NodeAttributes.DisableEditing);

            if (!attributes.HasFlag(NodeAttributes.HideChildren))
            {
                Children = new List <TreeDataNode>();
                AddObjectChildren();
            }
        }
Ejemplo n.º 2
0
        public TreeDataArrayNode(object parent, FieldOrProperty member, NodeAttributes attributes)
            : base(parent)
        {
            Name     = member.GetName();
            TypeName = member.GetMemberType().GetFriendlyName();

            ParentFieldEntry = member;

            if (!attributes.HasFlag(NodeAttributes.HideChildren))
            {
                Children = new List <TreeDataNode>();
                AddArrayChildren();
            }
        }
        public TreeDataObjectNode(object instance, string name, NodeAttributes attributes)
            : base(null)
        {
            if (instance == null)
            {
                throw new ArgumentNullException("Not supported. Use TreeDataClassMemberHolder instead if objects are potentially null.", nameof(instance));
            }

            Name     = name;
            TypeName = instance.GetType().GetFriendlyName();

            ObjectInstance = instance;

            if (!attributes.HasFlag(NodeAttributes.HideChildren))
            {
                Children = new List <TreeDataNode>();
                AddObjectChildren();
            }
        }