Reflection ArrayList

  • Thread starter Thread starter Elmer Miller
  • Start date Start date
E

Elmer Miller

Hello,
ArrayList a = new ArrayList();
Type t = a.GetType();
FieldInfo[] InnerList =t.GetFields(BindingFlags.Public |
BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);


When the above code runs on Compact Framework we get three items: (_items,
_size, _version)
But when you run the code on full framework you get 4 items (_items,
_size,_version,_syncRoot)

I can't figure out why reflection can't see the syncRoot becacuse this
should be supported on the CF.
Any ideas???
 
Reflection cannot see it because it's not actually there. If you look at the
definition for ArrayList in a utility such as Reflector or ildasm you can
see that in the full framework all four items are there but in the compact
framework only the three items that you listed are present.
 
Back
Top