I am trying to use reflection to list the public members and methods of a few classes in various projects inside of one Visual Studio solution. All of the classes I am trying to access are C# and they are all being accessed from a C# class. The code I'm using to make these calls is as follows:
public void PopulateEventParamTree()
{
System.Console.WriteLine(source.GetType().ToString());
Type type = (Type)source.getEventType();
System.Console.WriteLine(type.ToString());
foreach (MemberInfo member in type.GetMembers())
{
System.Console.WriteLine("\t" + member.ToString());
}
}
Most of the outputs work fine (i.e. Int32, Double, System.String). My problem is that when I try to list enums I get an output to the console that looks like this:
Namespace.Subspace.event+EVENT_TYPE
I would like to be able to see all of the inner values of the enum instead of just its name. For example, the enum
public enum EVENT_TYPE
{
EVENTDOWN,
EVENTMOVE,
EVENTUP,
}
should output something like this
Namespace.Subspace.class+EVENT_TYPE EVENTDOWN
Namespace.Subspace.class+EVENT_TYPE EVENTMOVE
Namespace.Subspace.class+EVENT_TYPE EVENTUP
Any help that anyone can provide would be greatly appreciated. I've exhausted everything I've been able to find thus far but a fresh perspective would be nice.
Thanks