Hi Tarscher,
Can you check that your class declarations are correct, or post them here?
The following sample will yield "true" for isTransporter.
class Unit { }
class Transporter : Unit { }
class Bus : Transporter { }
class Car : Transporter { }
static void Main(string[] args)
{
Bus bus = new Bus();
bool isTransporter = bus is Transporter;
}
--
Stanimir Stoyanov
http://stoyanoff.info
"Tarscher" <(E-Mail Removed)> wrote in message
news:62493dcf-4d66-420d-80ff-(E-Mail Removed)...
> Hi all,
>
> I have classes: Unit, Transporter, Bus and Car
>
> Transporter inherits from Unit and Bus and Car inherit from
> Transporter.
>
> I want to be able to do
> Bus bus = new Bus()
> if (bus is Transporter)
> {
> //....
> }
>
> Apparently .net only validates bus is Bus .
>
> How can i do this?
>
> Thanks
> Stijn