Shawn,
Really what you are looking at doing is not he best use of reflection.emit.
Since to use the new type you would need reflection to access its members it
does not make sense. If you are just creating a type to be a container
create a property bag class that you can store your values in and add/remove
them dynamically. What is the greater problem here, and why would you need a
type that is defined temporary. If you really want to go down the emit road
you can create a base class and derive from it adding your new
functionality. That way you can cast back for common functionality and
helpers while using the other reflection metadata to accomplish what you
are trying to do.
Mark
"Shawn" <Sh***@discussions.microsoft.comwrote in message
news:09**********************************@microsof t.com...
Hi;
i just started research reflection and i'm wondering if i have an empty
class file can i use reflection to add member variables and attributes
dynamically and then instantiate the class?
What i would like to be able to do is start with and empty class, then
depending on the data provided to me by a config file, add the member
variables and attributes to the class temporarily. when the app is
shutdown
all changes would be gone.
can anyone point me to any articles or a book that might go over something
like this?
Thanks for any help.