Esempio n. 1
0
        protected static ObjectListNode AddObjectListNode
        (
            TreeNode parentNode,
            string title,
            IEnumerable <UObject> objects,
            string imageName = "TreeView"
        )
        {
            if (objects == null)
            {
                return(null);
            }

            var uObjects = objects as List <UObject> ?? objects.ToList();

            if (uObjects.Any())
            {
                var listNode = new ObjectListNode(imageName)
                {
                    Text = title
                };
                foreach (var obj in uObjects)
                {
                    AddObjectNode(listNode, obj);
                }
                parentNode.Nodes.Add(listNode);
                return(listNode);
            }
            return(null);
        }
Esempio n. 2
0
        protected override void PostAddChildren( TreeNode node )
        {
            if( Properties == null || Properties.Count <= 0 )
                return;

            var defNode = new ObjectListNode
            {
                Text = "Default Values",
                ImageKey = "UDefaultProperty",
                SelectedImageKey = "UDefaultProperty"
            };
            node.Nodes.Add( defNode );
            foreach( var def in Properties )
            {
                var objN = new DefaultObjectNode( def ){Text = def.Name};
                defNode.Nodes.Add( objN );
            }
        }
Esempio n. 3
0
        protected override void PostAddChildren(TreeNode node)
        {
            if (Properties == null || Properties.Count <= 0)
            {
                return;
            }

            var defNode = new ObjectListNode
            {
                Text             = "Default Values",
                ImageKey         = "UDefaultProperty",
                SelectedImageKey = "UDefaultProperty"
            };

            node.Nodes.Add(defNode);
            foreach (var def in Properties)
            {
                var objN = new DefaultObjectNode(def)
                {
                    Text = def.Name
                };
                defNode.Nodes.Add(objN);
            }
        }
Esempio n. 4
0
        protected static ObjectListNode AddObjectListNode
        (
            TreeNode parentNode,
            string title,
            IEnumerable<UObject> objects,
            string imageName = "TreeView"
        )
        {
            if( objects == null )
                return null;

            var uObjects = objects as List<UObject> ?? objects.ToList();
            if( uObjects.Any() )
            {
                var listNode = new ObjectListNode( imageName ){Text = title};
                foreach( var obj in uObjects )
                {
                    AddObjectNode( listNode, obj );
                }
                parentNode.Nodes.Add( listNode );
                return listNode;
            }
            return null;
        }