On Sat, Oct 17, 2009 at 10:58 AM, Smjert <[email protected]> wrote:
> Anyway, it seems that the shorter way is to modify that if.....

Yeah, honestly, I'd probably do something like

private static Type[] typeListFoo = { typeof(ClassA), typeof(ClassB) };

Then, if you are targeting 3.5, use Linq:

Type objectType = theObject.GetType();
if (typeListFoo.Any(type => type.IsAssignableFrom(objectType))) { ... }

-- 
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

Reply via email to