public static Type FindCommonType(this Type c1, Type c2) { if (c1.IsAssignableTo(c2)) { return c2; } if (c2.IsAssignableTo(c1)) { return c1; } // No EASY common type found // will have to look harder?? return null; }
public bool CanAssignFrom(Type c) { return c.IsAssignableTo(this); }