Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetMethodFromSchemaProvider()

static MethodInfo System.Xml.Serialization.XmlReflectionImporter.GetMethodFromSchemaProvider ( XmlSchemaProviderAttribute provider,
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type type )
inlinestaticpackage

Definition at line 478 of file XmlReflectionImporter.cs.

479 {
480 if (provider.IsAny)
481 {
482 return null;
483 }
484 if (provider.MethodName == null)
485 {
486 throw new ArgumentNullException("MethodName");
487 }
488 if (!CSharpHelpers.IsValidLanguageIndependentIdentifier(provider.MethodName))
489 {
490 throw new ArgumentException(System.SR.Format(System.SR.XmlGetSchemaMethodName, provider.MethodName), "MethodName");
491 }
492 MethodInfo method = (method = type.GetMethod(provider.MethodName, BindingFlags.Static | BindingFlags.Public, new Type[1] { typeof(XmlSchemaSet) }));
493 if (method == null)
494 {
495 throw new InvalidOperationException(System.SR.Format(System.SR.XmlGetSchemaMethodMissing, provider.MethodName, "XmlSchemaSet", type.FullName));
496 }
497 if (!typeof(XmlQualifiedName).IsAssignableFrom(method.ReturnType) && !typeof(XmlSchemaType).IsAssignableFrom(method.ReturnType))
498 {
499 throw new InvalidOperationException(System.SR.Format(System.SR.XmlGetSchemaMethodReturnType, type.Name, provider.MethodName, "XmlSchemaProviderAttribute", typeof(XmlQualifiedName).FullName, typeof(XmlSchemaType).FullName));
500 }
501 return method;
502 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlGetSchemaMethodMissing
Definition SR.cs:1754
static string XmlGetSchemaMethodName
Definition SR.cs:1752
static string XmlGetSchemaMethodReturnType
Definition SR.cs:1756
Definition SR.cs:7

References System.Xml.ArgumentException, System.Xml.Dictionary, System.SR.Format(), System.FullName, System.CSharpHelpers.IsValidLanguageIndependentIdentifier(), System.type, System.SR.XmlGetSchemaMethodMissing, System.SR.XmlGetSchemaMethodName, and System.SR.XmlGetSchemaMethodReturnType.

Referenced by System.Xml.Serialization.XmlReflectionImporter.ImportSpecialMapping().