public static bool IsInstanceOf(this Type type, object o) { return o.GetType() == type || o.GetType().GetTypeInfo().IsSubclassOf(type); }