Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Datatype_short.cs
Go to the documentation of this file.
1namespace System.Xml.Schema;
2
4{
5 private static readonly Type s_atomicValueType = typeof(short);
6
7 private static readonly Type s_listValueType = typeof(short[]);
8
9 private static readonly FacetsChecker s_numeric10FacetsChecker = new Numeric10FacetsChecker(-32768m, 32767m);
10
12
13 public override XmlTypeCode TypeCode => XmlTypeCode.Short;
14
15 public override Type ValueType => s_atomicValueType;
16
17 internal override Type ListValueType => s_listValueType;
18
19 internal override int Compare(object value1, object value2)
20 {
21 return ((short)value1).CompareTo((short)value2);
22 }
23
24 internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue)
25 {
26 typedValue = null;
27 Exception ex = s_numeric10FacetsChecker.CheckLexicalFacets(ref s, this);
28 if (ex == null)
29 {
30 ex = XmlConvert.TryToInt16(s, out var result);
31 if (ex == null)
32 {
33 ex = s_numeric10FacetsChecker.CheckValueFacets(result, this);
34 if (ex == null)
35 {
36 typedValue = result;
37 return null;
38 }
39 }
40 }
41 return ex;
42 }
43}
static readonly Type s_atomicValueType
static readonly FacetsChecker s_numeric10FacetsChecker
override int Compare(object value1, object value2)
static readonly Type s_listValueType
override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue)
static Exception TryToInt16(string s, out short result)
TypeCode
Definition TypeCode.cs:4