コード例 #1
0
        private void dataGridEh1_TreeViewArea_ExpandedStateSet(object sender, DataGridTreeViewNodeExpandedStateSetEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }
            SimpleTreeViewNode node = (SimpleTreeViewNode)e.Row.SourceItem;

            node.Expanded = e.Expanded;
            RebuildFlatList();
        }
コード例 #2
0
        public void LoadData()
        {
            Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();

            foreach (Assembly assembly in assemblies)
            {
                SimpleTreeViewNode asseblyNode = new SimpleTreeViewNode()
                {
                    Name = assembly.GetName().Name
                };

                baseTreeList.AddNode(asseblyNode, null, TreeListNodeAttachMode.AddChild, false);
                //asseblyNode.Expanded = true;

                { //Level  2 namespaces
                    var namespaces = assembly.GetTypes()
                                     .Select(t => t.Namespace)
                                     .Distinct();

                    foreach (string namespaceName in namespaces)
                    {
                        if (String.IsNullOrEmpty(namespaceName))
                        {
                            continue;
                        }

                        SimpleTreeViewNode nsNode = new SimpleTreeViewNode()
                        {
                            Name = namespaceName
                        };

                        baseTreeList.AddNode(nsNode, asseblyNode, TreeListNodeAttachMode.AddChild, false);
                        //nsNode.Expanded = true;

                        { // Level 3 Types
                            foreach (Type type in assembly.GetTypes())
                            {
                                if (type.Namespace == namespaceName)
                                {
                                    SimpleTreeViewNode typeNode = new SimpleTreeViewNode()
                                    {
                                        Name = type.Name
                                    };

                                    baseTreeList.AddNode(typeNode, nsNode, TreeListNodeAttachMode.AddChild, false);
                                }
                            }
                        }
                    }
                }
            }

            RebuildFlatList();
        }
コード例 #3
0
        private void dataGridEh1_TreeViewArea_NodeStateNeeded(object sender, DataGridTreeViewNodeStateNeededEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }
            SimpleTreeViewNode node = (SimpleTreeViewNode)e.Row.SourceItem;

            e.NodeLevel   = node.Level;
            e.HasChildren = node.HasChildren;
            e.Expanded    = node.Expanded;
            e.ParentItem  = node.Parent;
        }