示例#1
0
        public static void AddInstances(ResourceMaps.LongMap map, ResourceTreeNodeExt tn, bool group, bool type)
        {
            List <ResourceTreeNodeExt> nodelist = new List <ResourceTreeNodeExt>();

            foreach (ulong inst in map.Keys)
            {
                ResourceViewManager.ResourceNameList list = map[inst];
                ResourceTreeNodeExt node = new ResourceTreeNodeExt(inst, list, "0x" + Helper.HexString(inst));
                if (group)
                {
                    ResourceTreeNodeExt groupnode = new ResourceTreeNodeExt(inst, list, "Groups");
                    AddSubNodesForGroups(groupnode, list);
                    node.Nodes.Add(groupnode);
                }
                if (type)
                {
                    ResourceTreeNodeExt typenode = new ResourceTreeNodeExt(inst, list, "Types");
                    ResourceTreeNodesByGroup.AddSubNodesForTypes(typenode, list);
                    node.Nodes.Add(typenode);
                }

                nodelist.Add(node);
            }

            nodelist.Sort();
            foreach (ResourceTreeNodeExt node in nodelist)
            {
                tn.Nodes.Add(node);
            }
        }
示例#2
0
        public static void AddSubNodesForInstances(ResourceTreeNodeExt node, ResourceViewManager.ResourceNameList resources)
        {
            ResourceMaps.LongMap map = new ResourceMaps.LongMap();
            foreach (NamedPackedFileDescriptor pfd in resources)
            {
                ResourceViewManager.ResourceNameList list;
                if (!map.ContainsKey(pfd.Descriptor.LongInstance))
                {
                    list = new ResourceViewManager.ResourceNameList();
                    map.Add(pfd.Descriptor.LongInstance, list);
                }
                else
                {
                    list = map[pfd.Descriptor.LongInstance];
                }

                list.Add(pfd);
            }

            ResourceTreeNodesByInstance.AddInstances(map, node, false, false);
        }