示例#1
0
文件: Main.cs 项目: tea/MOSA-Project
        protected void UpdateTree()
        {
            treeView.BeginUpdate();
            treeView.Nodes.Clear();

            //Cycle through all metadata tables
            foreach (TableType table in Enum.GetValues(typeof(TableType)))
            {
                if (table == TableType.Module)
                    continue;

                int count = metadataModule.Metadata.GetRowCount(table);

                if (count == 0)
                    continue;

                TreeNode tableNode = new TreeNode("[" + table.FormatToString() + "] " + table.ToString() + " (" + count.ToString() + ")");
                treeView.Nodes.Add(tableNode);

                //Cycle through all metadata rows
                for (int rowid = 1; rowid <= count; rowid++)
                {
                    Token token = new Token(table, rowid);

                    TableRow row = Resolver.GetTableRow(metadataModule, token);

                    if (row == null)
                        continue;

                    TreeNode rowNode = new TreeNode(token.FormatToString() + " - " + row.Name);
                    tableNode.Nodes.Add(rowNode);

                    foreach (KeyValuePair<string, string> data in row.GetValues())
                    {
                        TreeNode rowValueNode = new TreeNode(data.Key + ": " + data.Value);
                        rowNode.Nodes.Add(rowValueNode);
                    }
                }
            }

            treeView.EndUpdate();
        }
示例#2
0
 protected KeyValuePair<string, string> Value(string name, Token token)
 {
     return Value(name, token.FormatToString());
 }