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

◆ IsValidRestriction()

bool System.Xml.Schema.SchemaCollectionCompiler.IsValidRestriction ( XmlSchemaParticle derivedParticle,
XmlSchemaParticle baseParticle )
inlineprivate

Definition at line 1203 of file SchemaCollectionCompiler.cs.

1204 {
1206 {
1207 return true;
1208 }
1209 if (derivedParticle == null || derivedParticle == XmlSchemaParticle.Empty)
1210 {
1212 }
1213 if (baseParticle == null || baseParticle == XmlSchemaParticle.Empty)
1214 {
1215 return false;
1216 }
1217 if (baseParticle is XmlSchemaElement)
1218 {
1219 if (derivedParticle is XmlSchemaElement)
1220 {
1221 return IsElementFromElement((XmlSchemaElement)derivedParticle, (XmlSchemaElement)baseParticle);
1222 }
1223 return false;
1224 }
1225 if (baseParticle is XmlSchemaAny)
1226 {
1227 if (derivedParticle is XmlSchemaElement)
1228 {
1229 return IsElementFromAny((XmlSchemaElement)derivedParticle, (XmlSchemaAny)baseParticle);
1230 }
1231 if (derivedParticle is XmlSchemaAny)
1232 {
1233 return IsAnyFromAny((XmlSchemaAny)derivedParticle, (XmlSchemaAny)baseParticle);
1234 }
1235 return IsGroupBaseFromAny((XmlSchemaGroupBase)derivedParticle, (XmlSchemaAny)baseParticle);
1236 }
1237 if (baseParticle is XmlSchemaAll)
1238 {
1239 if (derivedParticle is XmlSchemaElement)
1240 {
1241 return IsElementFromGroupBase((XmlSchemaElement)derivedParticle, (XmlSchemaGroupBase)baseParticle, skipEmptableOnly: true);
1242 }
1243 if (derivedParticle is XmlSchemaAll)
1244 {
1245 return IsGroupBaseFromGroupBase((XmlSchemaGroupBase)derivedParticle, (XmlSchemaGroupBase)baseParticle, skipEmptableOnly: true);
1246 }
1247 if (derivedParticle is XmlSchemaSequence)
1248 {
1249 return IsSequenceFromAll((XmlSchemaSequence)derivedParticle, (XmlSchemaAll)baseParticle);
1250 }
1251 }
1252 else if (baseParticle is XmlSchemaChoice)
1253 {
1254 if (derivedParticle is XmlSchemaElement)
1255 {
1256 return IsElementFromGroupBase((XmlSchemaElement)derivedParticle, (XmlSchemaGroupBase)baseParticle, skipEmptableOnly: false);
1257 }
1258 if (derivedParticle is XmlSchemaChoice)
1259 {
1260 return IsGroupBaseFromGroupBase((XmlSchemaGroupBase)derivedParticle, (XmlSchemaGroupBase)baseParticle, skipEmptableOnly: false);
1261 }
1262 if (derivedParticle is XmlSchemaSequence)
1263 {
1264 return IsSequenceFromChoice((XmlSchemaSequence)derivedParticle, (XmlSchemaChoice)baseParticle);
1265 }
1266 }
1267 else if (baseParticle is XmlSchemaSequence)
1268 {
1269 if (derivedParticle is XmlSchemaElement)
1270 {
1271 return IsElementFromGroupBase((XmlSchemaElement)derivedParticle, (XmlSchemaGroupBase)baseParticle, skipEmptableOnly: true);
1272 }
1273 if (derivedParticle is XmlSchemaSequence)
1274 {
1275 return IsGroupBaseFromGroupBase((XmlSchemaGroupBase)derivedParticle, (XmlSchemaGroupBase)baseParticle, skipEmptableOnly: true);
1276 }
1277 }
1278 return false;
1279 }
bool IsGroupBaseFromAny(XmlSchemaGroupBase derivedGroupBase, XmlSchemaAny baseAny)
bool IsAnyFromAny(XmlSchemaAny derivedAny, XmlSchemaAny baseAny)
bool IsElementFromGroupBase(XmlSchemaElement derivedElement, XmlSchemaGroupBase baseGroupBase, bool skipEmptableOnly)
bool IsSequenceFromChoice(XmlSchemaSequence derivedSequence, XmlSchemaChoice baseChoice)
bool IsSequenceFromAll(XmlSchemaSequence derivedSequence, XmlSchemaAll baseAll)
bool IsParticleEmptiable(XmlSchemaParticle particle)
bool IsElementFromAny(XmlSchemaElement derivedElement, XmlSchemaAny baseAny)
bool IsGroupBaseFromGroupBase(XmlSchemaGroupBase derivedGroupBase, XmlSchemaGroupBase baseGroupBase, bool skipEmptableOnly)
bool IsElementFromElement(XmlSchemaElement derivedElement, XmlSchemaElement baseElement)

References System.Xml.Schema.XmlSchemaParticle.Empty, System.Xml.Schema.SchemaCollectionCompiler.IsAnyFromAny(), System.Xml.Schema.SchemaCollectionCompiler.IsElementFromAny(), System.Xml.Schema.SchemaCollectionCompiler.IsElementFromElement(), System.Xml.Schema.SchemaCollectionCompiler.IsElementFromGroupBase(), System.Xml.Schema.SchemaCollectionCompiler.IsGroupBaseFromAny(), System.Xml.Schema.SchemaCollectionCompiler.IsGroupBaseFromGroupBase(), System.Xml.Schema.SchemaCollectionCompiler.IsParticleEmptiable(), System.Xml.Schema.SchemaCollectionCompiler.IsSequenceFromAll(), and System.Xml.Schema.SchemaCollectionCompiler.IsSequenceFromChoice().

Referenced by System.Xml.Schema.SchemaCollectionCompiler.CheckParticleDerivation(), System.Xml.Schema.SchemaCollectionCompiler.GetMappingParticle(), System.Xml.Schema.SchemaCollectionCompiler.IsElementFromGroupBase(), System.Xml.Schema.SchemaCollectionCompiler.IsGroupBaseFromAny(), and System.Xml.Schema.SchemaCollectionCompiler.IsGroupBaseFromGroupBase().