C#: Basic Reflection Class
- by Mike
I'm trying to find a basic reflection abstract class that will generate basic information about a class. I have a template of how I would like it to work:
class ThreeList<string,Type,T>
{
string Name {get; set;}
Type Type {get; set;}
T Value {get; set;}
}
abstract class Reflect<T>
{
List<ThreeList<string, Type, T> list;
ReturnType MethodName()
{
foreach (System.Reflection.PropertyInfo prop in this.GetType().GetProperties())
{
object value = prop.GetValue(this, new object[] { });
list.Add(prop.Name, prop.DeclaringType, value);
}
}
}
I'd like it to be infinitely deep, recursively calling Reflect.
Something like this has to exist. I'm not really opposed to coding it myself, I just don't want to go through the hassle if its already been done.