[Mono-list] Mono parsing error on multiline if
Chris Howie
cdhowie at gmail.com
Sat Oct 17 22:52:38 EDT 2009
On Sat, Oct 17, 2009 at 10:58 AM, Smjert <smjert30 at libero.it> 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
More information about the Mono-list
mailing list