On Mon, Sep 29, 2008 at 4:46 PM, Esdras Beleza <[EMAIL PROTECTED]> wrote:
> The question is: how can I iterate inside a namespace classlist, and create
> a new instance of each class of it?
There is no cut and dried way to do this, but you can do something like this:
IEnumerable<Type> GetTypesInNamespace(string namespace) {
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) {
foreach (Type type in assembly.GetTypes()) {
if (type.Namespace == namespace)
yield return type;
}
}
}
Or you can do something LINQy. :)
--
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers
_______________________________________________
Mono-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list