J
J. Jones
Suppose the following:
class MyContainer : System.Collections.CollectionBase
{
//...
}
(where CollectionBase implements IList, ICollection)
How do I determine if a type (such as MyContainer) derives from IList?
System.Type type = typeof(MyContainer);
type is IList -> false
type.IsSubclassOf(typeof(IList)) -> false
type.IsAssignableFrom(typeof(IList)) -> false
etc., all tests return false.
So, what I need is a way to determine if a particular type derives from IList,
no matter how far up the hierarchy it is.
Thanks
class MyContainer : System.Collections.CollectionBase
{
//...
}
(where CollectionBase implements IList, ICollection)
How do I determine if a type (such as MyContainer) derives from IList?
System.Type type = typeof(MyContainer);
type is IList -> false
type.IsSubclassOf(typeof(IList)) -> false
type.IsAssignableFrom(typeof(IList)) -> false
etc., all tests return false.
So, what I need is a way to determine if a particular type derives from IList,
no matter how far up the hierarchy it is.
Thanks