Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SqlGuidStorage.cs
Go to the documentation of this file.
4using System.IO;
5using System.Xml;
7
8namespace System.Data.Common;
9
10internal sealed class SqlGuidStorage : DataStorage
11{
12 private SqlGuid[] _values;
13
18
19 public override object Aggregate(int[] records, AggregateType kind)
20 {
21 try
22 {
23 switch (kind)
24 {
25 case AggregateType.First:
26 if (records.Length != 0)
27 {
28 return _values[records[0]];
29 }
30 return null;
31 case AggregateType.Count:
32 {
33 int num = 0;
34 for (int i = 0; i < records.Length; i++)
35 {
36 if (!IsNull(records[i]))
37 {
38 num++;
39 }
40 }
41 return num;
42 }
43 }
44 }
45 catch (OverflowException)
46 {
48 }
50 }
51
52 public override int Compare(int recordNo1, int recordNo2)
53 {
55 }
56
57 public override int CompareValueTo(int recordNo, object value)
58 {
60 }
61
62 public override object ConvertValue(object value)
63 {
64 if (value != null)
65 {
67 }
68 return _nullValue;
69 }
70
71 public override void Copy(int recordNo1, int recordNo2)
72 {
74 }
75
76 public override object Get(int record)
77 {
78 return _values[record];
79 }
80
81 public override bool IsNull(int record)
82 {
83 return _values[record].IsNull;
84 }
85
86 public override void Set(int record, object value)
87 {
89 }
90
91 public override void SetCapacity(int capacity)
92 {
94 if (_values != null)
95 {
97 }
98 _values = array;
99 }
100
101 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
102 public override object ConvertXmlToObject(string s)
103 {
104 SqlGuid sqlGuid = default(SqlGuid);
105 string s2 = "<col>" + s + "</col>";
108 using (XmlTextReader reader = new XmlTextReader(input))
109 {
110 xmlSerializable.ReadXml(reader);
111 }
112 return (SqlGuid)(object)xmlSerializable;
113 }
114
115 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
116 public override string ConvertObjectToXml(object value)
117 {
118 StringWriter stringWriter = new StringWriter(base.FormatProvider);
120 {
121 ((IXmlSerializable)value).WriteXml(writer);
122 }
123 return stringWriter.ToString();
124 }
125
126 protected override object GetEmptyStorage(int recordCount)
127 {
128 return new SqlGuid[recordCount];
129 }
130
131 protected override void CopyValue(int record, object store, BitArray nullbits, int storeIndex)
132 {
133 SqlGuid[] array = (SqlGuid[])store;
136 }
137
138 protected override void SetStorage(object store, BitArray nullbits)
139 {
140 _values = (SqlGuid[])store;
141 }
142}
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
static SqlGuid ConvertToSqlGuid(object value)
override void Set(int record, object value)
override string ConvertObjectToXml(object value)
override int Compare(int recordNo1, int recordNo2)
override void SetCapacity(int capacity)
override void CopyValue(int record, object store, BitArray nullbits, int storeIndex)
override void SetStorage(object store, BitArray nullbits)
override object Get(int record)
override object ConvertValue(object value)
override void Copy(int recordNo1, int recordNo2)
override object GetEmptyStorage(int recordCount)
override int CompareValueTo(int recordNo, object value)
override object Aggregate(int[] records, AggregateType kind)
override bool IsNull(int record)
override object ConvertXmlToObject(string s)
static Exception AggregateException(AggregateType aggregateType, Type type)
static Exception Overflow(Type type)
static byte Min(byte val1, byte val2)
Definition Math.cs:912
int CompareTo(object? value)
Definition SqlGuid.cs:232