M
Magnus
i have a class which inherits from a base class
class base1 {
}
class child1 : base1 {
}
how can I determine if child1 is of base1? gettype returns type of child1,
but I need to know the type of the class inherited from, the base class.
Casting will cause an exception if the base class is of the wrong type, I
would like to avoid any exception approach.
I basically would like to know if I can cast the object to one or the other
type. Any ideas?
Thank you.
- Magnus
class base1 {
}
class child1 : base1 {
}
how can I determine if child1 is of base1? gettype returns type of child1,
but I need to know the type of the class inherited from, the base class.
Casting will cause an exception if the base class is of the wrong type, I
would like to avoid any exception approach.
I basically would like to know if I can cast the object to one or the other
type. Any ideas?
Thank you.
- Magnus