public virtual bool IsSubtype(Type type, Type supertype)
{
if (type == null)
return false;
if (type == supertype)
return true;
if (supertype == typeof(object))
return true;
Type[] ancestors = GetAncestors(type);
if (((IList) ancestors).Contains(supertype))
return true;
return GetSupertypingAdapter(supertype, type) != null;
}