Reflection (again!)--how do I identify a Visual Basic Module?

  • Thread starter Thread starter Jeff Johnson [MVP: VB]
  • Start date Start date
J

Jeff Johnson [MVP: VB]

Subject pretty much says it all. When iterating over GetTypes(), Modules
have their IsClass property set to True (and there's obviously no IsModule
property--I'm not THAT dense), so currently my code is interpreting them as
classes. Any suggestions?
 
Jeff,

Modules have the custom attribute
Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute applied
to them, you can check if it's there with Type.GetCustomAttributes.



Mattias
 
Modules have the custom attribute
Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute applied
to them, you can check if it's there with Type.GetCustomAttributes.

Many thanks. Now how can I tell if a type is a Structure? And is there any
one place I could look to find this information for myself? (Besides this
group, of course....)
 
Jeff,
Now how can I tell if a type is a Structure?
Type.IsValueType


And is there any
one place I could look to find this information for myself? (Besides this
group, of course....)

I'm sure there must be some decent articles on Reflection out there,
but unfortunately I don't know any I can point you to. But pretty much
everything you'd want to know about a type is available from
System.Type.



Mattias
 
Back
Top