예제 #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);
        }
예제 #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 );
            }
        }
예제 #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);
            }
        }
예제 #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;
        }