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

◆ GetMinMax() [1/2]

void System.Data.XDRSchema.GetMinMax ( XmlElement elNode,
bool isAttribute,
ref int minOccurs,
ref int maxOccurs )
inlinepackage

Definition at line 420 of file XDRSchema.cs.

421 {
422 string attribute = elNode.GetAttribute("minOccurs");
423 if (attribute != null && attribute.Length > 0)
424 {
425 try
426 {
428 }
429 catch (Exception e) when (ADP.IsCatchableExceptionType(e))
430 {
431 throw ExceptionBuilder.AttributeValues("minOccurs", "0", "1");
432 }
433 }
434 attribute = elNode.GetAttribute("maxOccurs");
435 if (attribute == null || attribute.Length <= 0)
436 {
437 return;
438 }
439 if (string.Compare(attribute, "*", StringComparison.Ordinal) == 0)
440 {
441 maxOccurs = -1;
442 return;
443 }
444 try
445 {
447 }
448 catch (Exception e2) when (ADP.IsCatchableExceptionType(e2))
449 {
450 throw ExceptionBuilder.AttributeValues("maxOccurs", "1", "*");
451 }
452 if (maxOccurs == 1)
453 {
454 return;
455 }
456 throw ExceptionBuilder.AttributeValues("maxOccurs", "1", "*");
457 }
static bool IsCatchableExceptionType(Exception e)
Definition ADP.cs:790
static CultureInfo InvariantCulture

References System.Data.ExceptionBuilder.AttributeValues(), System.Xml.Dictionary, System.Globalization.CultureInfo.InvariantCulture, and System.Data.Common.ADP.IsCatchableExceptionType().