private void RetrieveSerializableSchema()
{
if (_needSchema)
{
_needSchema = false;
if (_getSchemaMethod != null)
{
// get the type info
object typeInfo = _getSchemaMethod.Invoke(null, new object[] { _schemas });
_xsiType = XmlQualifiedName.Empty;
if (typeInfo != null)
{
if (typeof(XmlSchemaType).IsAssignableFrom(_getSchemaMethod.ReturnType))
{
throw Globals.NotSupported("No XmlSchemaType in SL");
}
else if (typeof(XmlQualifiedName).IsAssignableFrom(_getSchemaMethod.ReturnType))
{
_xsiType = (XmlQualifiedName)typeInfo;
if (_xsiType.IsEmpty)
{
throw new InvalidOperationException(SR.Format(SR.XmlGetSchemaEmptyTypeName, _type.FullName, _getSchemaMethod.Name));
}
}
else
{
throw new InvalidOperationException(SR.Format(SR.XmlGetSchemaMethodReturnType, _type.Name, _getSchemaMethod.Name, typeof(XmlSchemaProviderAttribute).Name, typeof(XmlQualifiedName).FullName));
}
}
else
{
_any = true;
}
}
}
}