Hi Chris, > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Chris Howie > Sent: Sunday, October 05, 2008 1:17 PM > To: Mono mailing list > Subject: Re: [Mono-list] Instantiating all classes from a namespace > > On Sun, Oct 5, 2008 at 1:58 PM, Charlie Poole > <[EMAIL PROTECTED]> wrote: > > That doesn't instantiate them, which is much harder in general. > > > > Say a Type has only one consructor, which takes an object > of class A. > > Now you have to instantiate A. But maybe A ony has a constructor > > requiring a B... :-) > > > > Hopefully, the OP doesn't want to solve the most general > case, but has > > some specific limits he has not told us about yet. > > In any case like this you create a contract that such classes > must have a specific constructor. It is madness not to.
Yes, that would be an approach. Personally, I'd prefer an interface as a marker (or a custom attribute) with the absence of a proper constructor treated as an error - it seems less prone to accidentally including a class. Charlie > -- > 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 > _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
