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

◆ CheckContext()

void System.Xml.Serialization.XmlReflectionImporter.CheckContext ( TypeDesc typeDesc,
ImportContext context )
inlineprivate

Definition at line 1136 of file XmlReflectionImporter.cs.

1137 {
1138 switch (context)
1139 {
1140 case ImportContext.Element:
1141 if (typeDesc.CanBeElementValue)
1142 {
1143 return;
1144 }
1145 break;
1146 case ImportContext.Attribute:
1147 if (typeDesc.CanBeAttributeValue)
1148 {
1149 return;
1150 }
1151 break;
1152 case ImportContext.Text:
1153 if (typeDesc.CanBeTextValue || typeDesc.IsEnum || typeDesc.IsPrimitive)
1154 {
1155 return;
1156 }
1157 break;
1158 default:
1159 throw new ArgumentException(System.SR.XmlInternalError, "context");
1160 }
1161 throw UnsupportedException(typeDesc, context);
1162 }
static string XmlInternalError
Definition SR.cs:1812
Definition SR.cs:7
static Exception UnsupportedException(TypeDesc typeDesc, ImportContext context)

References System.Xml.ArgumentException, System.Xml.Serialization.XmlReflectionImporter.UnsupportedException(), and System.SR.XmlInternalError.

Referenced by System.Xml.Serialization.XmlReflectionImporter.ImportPrimitiveMapping(), and System.Xml.Serialization.XmlReflectionImporter.ImportSpecialMapping().