[C#] Fieldinfo[]'s with Generic classes
Posted: Tue Apr 29, 2008 2:42 pm
Well, I set up a class for my reflexives like so:
And I harcoded my Tags like engineer. But when I get a Reflexive<Chunk> field type, and I try to do:
I get an array with 0 entrys for the line with the comment.
Can any one help me with this?
Code: Select all
public class Reflexive<T> : List<T> where T : Chunk
{
}
Code: Select all
foreach (FieldInfo f in Tag.Fields)
{
//Blah Blah Blah
else if (f.FieldType.IsGenericType && f.FieldType.GetGenericTypeDefinition() == typeof(Reflexive<>))
{
//-----------More stuff not important
//Right here, I get an array with 0 Entrys
FieldInfo[] FFields = f.GetType().GetFields();
}
}
Can any one help me with this?