Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SqlDateTimeStorage.cs
Go to the documentation of this file.
4using System.IO;
5using System.Xml;
7
8namespace System.Data.Common;
9
10internal sealed class SqlDateTimeStorage : DataStorage
11{
13
18
19 public override object Aggregate(int[] records, AggregateType kind)
20 {
21 bool flag = false;
22 try
23 {
24 switch (kind)
25 {
26 case AggregateType.Min:
27 {
29 foreach (int num3 in records)
30 {
31 if (!IsNull(num3))
32 {
34 {
36 }
37 flag = true;
38 }
39 }
40 if (flag)
41 {
42 return sqlDateTime2;
43 }
44 return _nullValue;
45 }
46 case AggregateType.Max:
47 {
49 foreach (int num2 in records)
50 {
51 if (!IsNull(num2))
52 {
54 {
56 }
57 flag = true;
58 }
59 }
60 if (flag)
61 {
62 return sqlDateTime;
63 }
64 return _nullValue;
65 }
66 case AggregateType.First:
67 if (records.Length != 0)
68 {
69 return _values[records[0]];
70 }
71 return null;
72 case AggregateType.Count:
73 {
74 int num = 0;
75 for (int i = 0; i < records.Length; i++)
76 {
77 if (!IsNull(records[i]))
78 {
79 num++;
80 }
81 }
82 return num;
83 }
84 }
85 }
86 catch (OverflowException)
87 {
89 }
91 }
92
93 public override int Compare(int recordNo1, int recordNo2)
94 {
96 }
97
98 public override int CompareValueTo(int recordNo, object value)
99 {
101 }
102
103 public override object ConvertValue(object value)
104 {
105 if (value != null)
106 {
108 }
109 return _nullValue;
110 }
111
112 public override void Copy(int recordNo1, int recordNo2)
113 {
115 }
116
117 public override object Get(int record)
118 {
119 return _values[record];
120 }
121
122 public override bool IsNull(int record)
123 {
124 return _values[record].IsNull;
125 }
126
127 public override void Set(int record, object value)
128 {
130 }
131
132 public override void SetCapacity(int capacity)
133 {
135 if (_values != null)
136 {
138 }
139 _values = array;
140 }
141
142 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
143 public override object ConvertXmlToObject(string s)
144 {
146 string s2 = "<col>" + s + "</col>";
149 using (XmlTextReader reader = new XmlTextReader(input))
150 {
151 xmlSerializable.ReadXml(reader);
152 }
153 return (SqlDateTime)(object)xmlSerializable;
154 }
155
156 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
157 public override string ConvertObjectToXml(object value)
158 {
159 StringWriter stringWriter = new StringWriter(base.FormatProvider);
161 {
162 ((IXmlSerializable)value).WriteXml(writer);
163 }
164 return stringWriter.ToString();
165 }
166
167 protected override object GetEmptyStorage(int recordCount)
168 {
169 return new SqlDateTime[recordCount];
170 }
171
172 protected override void CopyValue(int record, object store, BitArray nullbits, int storeIndex)
173 {
177 }
178
179 protected override void SetStorage(object store, BitArray nullbits)
180 {
182 }
183}
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
static SqlDateTime ConvertToSqlDateTime(object value)
override object Aggregate(int[] records, AggregateType kind)
override int CompareValueTo(int recordNo, object value)
override void Copy(int recordNo1, int recordNo2)
override object ConvertValue(object value)
override void CopyValue(int record, object store, BitArray nullbits, int storeIndex)
override void SetStorage(object store, BitArray nullbits)
override object ConvertXmlToObject(string s)
override string ConvertObjectToXml(object value)
override void SetCapacity(int capacity)
override int Compare(int recordNo1, int recordNo2)
override object GetEmptyStorage(int recordCount)
override void Set(int record, object value)
static Exception AggregateException(AggregateType aggregateType, Type type)
static Exception Overflow(Type type)
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static SqlBoolean LessThan(SqlDateTime x, SqlDateTime y)
static readonly SqlDateTime MaxValue
static SqlBoolean GreaterThan(SqlDateTime x, SqlDateTime y)
static readonly SqlDateTime MinValue