void CheckSupportedMember(TypeDesc typeDesc, MemberInfo member, Type type) {
if (typeDesc == null)
return;
if (typeDesc.IsUnsupported) {
if (typeDesc.Exception == null) {
typeDesc.Exception = new NotSupportedException(Res.GetString(Res.XmlSerializerUnsupportedType, typeDesc.FullName));
}
throw new InvalidOperationException(Res.GetString(Res.XmlSerializerUnsupportedMember,member.DeclaringType.FullName + "." + member.Name, type.FullName), typeDesc.Exception);
}
CheckSupportedMember(typeDesc.BaseTypeDesc, member, type);
CheckSupportedMember(typeDesc.ArrayElementTypeDesc, member, type);
}