C # provides many ways to do this:
For an exact copy of a specific type, you need to do this
if (p.GetType() == typeof(YourDesiredType))
If you want to know if p is an instance of yourdesiredtype, then
if (p is YourDesiredType)
or you can try this
YourDesiredType ydp = p as YourDesiredType;
As in this case (since I'm not sure if this is possible in your scenario), when the OP wants to know the type of compilation, then I would recommend using a generic list for this
Because by keeping a list of safe types, everyone can easily track their type
Freak
source share