Its because "Is" works similar to Type.IsInstanceOfType which is very different from whether or not the type can be converted to the type. Think explicit conversions, the type is not the interface but can be converted to it.
It makes no difference between 1.1 and 3.5 the same issue applies. Cheers, Greg On Feb 11, 2008 2:06 PM, Niblett, Alex <[EMAIL PROTECTED]> wrote: > We have an old guidelines note to use IsAssignableFrom() followed by a > hard cast as opposed to using the 'as' keyword followed by a check for > null, but there is no explanation for why this approach should be used. > There are also no comments on the 'is' keyword approach to casting. Can > somebody please explain why? > > I don't appear to be giving Google the right keywords because I'm not > finding anything specific on this. This note was made in the .NET 1.1 > days and this code base is now .NET 2.0 with the possibility of going to > .NET 3.0 or 3.5 very soon. > > Alex > > ****************************************************************** > This email and any files transmitted with it from the El Paso > Corporation are confidential and intended solely for the > use of the individual or entity to whom they are addressed. > If you have received this email in error please notify the > sender. > ****************************************************************** > > =================================== > This list is hosted by DevelopMentor(R) http://www.develop.com > > View archives and manage your subscription(s) at http://discuss.develop.com > -- Studying for the Turing test =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com