Using this I'd add some lines to write to my text file where I've added the comment and messagebox. Need to be careful about getting hierachy correct but it should be a good starter for 10.
Alternatively there is a c# example in the UGS directories with the other ugopen axamples called "AssemblyViewer". I don't write in C# but it looks like this example only goes 1 level down into the assembly so this would have to be tweaked to go down the levels of the assy.