コード例 #1
0
        public void SetLuaTable(LuaTable table, TreeNodeAdv rootNode)
        {
            ExpandedNodesDictionary expanded = SaveExpandedNodes(rootNode);

            rootLuaTable = table;
            SetFilter(this.filter, true);
            RestoreExpandedNodes(rootNode, expanded);
        }
コード例 #2
0
        protected ExpandedNodesDictionary SaveExpandedNodes(TreeNodeAdv rootNode)
        {
            ExpandedNodesDictionary expandedObjects = new ExpandedNodesDictionary(rootNode.IsExpanded);

            foreach (TreeNodeAdv child in rootNode.Children)
            {
                LuaVariableItem item = child.Tag as LuaVariableItem;
                if (item != null && item.LuaValue.Type == LuaVariableType.Table)
                {
                    expandedObjects[item.LuaKey] = SaveExpandedNodes(child);
                }
            }
            return(expandedObjects);
        }
コード例 #3
0
 protected void RestoreExpandedNodes(TreeNodeAdv rootNode, ExpandedNodesDictionary expanded)
 {
     rootNode.IsExpanded = expanded.IsExpanded;
     foreach (TreeNodeAdv child in rootNode.Children)
     {
         LuaVariableItem item = child.Tag as LuaVariableItem;
         if (item != null)
         {
             ExpandedNodesDictionary childExpanded;
             if (expanded.TryGetValue(item.LuaKey, out childExpanded))
             {
                 RestoreExpandedNodes(child, childExpanded);
             }
         }
     }
 }