I am working on moving some pre-Windows 8 code to Windows 8
(i.e. making it windows 8 store compliant). There is a major change in the APIs
and the documentation sucks a lot. So I am going to write a series of posts on
equivalent APIs I have found so that people doing the same can find and use.
Assembly.GetTypes – This is not available and the equivalent
is Assembly.DefinedTypes. Note, this API now returns a collection of TypeInfo
and not Types.
So if you are looping thru types and working
on each type, you will have to now look thru TypeInfo and then do a
TypeInfo.GetType() to get access to the Type object. You can do the reverse by
Type.IsSubclass – Now becomes TypeInfo.IsSubclass
Type.IsInterface – Now becomes TypeInfo.IsInterface
Type.GetInterfaces – Now becomes TypeInfo.ImplementedInterfaces
Type.GetProperty - Now becomes Type.GetRuntimeProperty
Type.GetMethod - Now becomes Type.GetRuntimeMethod
Type.GetConstructor - Now becomes TypeInfo.DeclaredConstructors