You can use reflection to iterrate through methods, properties, etc. Using
this information, you could easily add these items as entries in a ListView
or a TreeView (then serialize it to XML, if so desired).
Here's a quick snippet that gets methods and properties from a TextBox
object, and adds them to a ListView (Be sure to include the System.Reflection
namespace):
private void button1_Click(object sender, System.EventArgs e)
{
Type t = typeof(TextBox);
//Get method info for an object
MethodInfo[] mI = t.GetMethods();
for (int x=0; x<mI.Length; x++)
{
ListViewItem lvi = new ListViewItem();
lvi.Text = mI[x].Name;
this.listBox1.Items.Add(lvi);
}
//Get properties for an object
PropertyInfo[] pI = t.GetProperties();
for (int x=0; x<pI.Length; x++)
{
ListViewItem lvi = new ListViewItem();
lvi.Text = pI[x].Name;
this.listBox1.Items.Add(lvi);
}
}
Hope it helps.
--
"Quae narravi, nullo modo negabo."
"Lee Crabtree" wrote:
Are there any tools that will take an existing assembly and generate a
class hierarchy from it? It seems like the kind of thing that would be
possible with reflection, but I don't know enough about that namespace
to tackle this.
Lee Crabtree