Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DateTimeOffsetStorage.cs
Go to the documentation of this file.
3using System.Xml;
4
5namespace System.Data.Common;
6
7internal sealed class DateTimeOffsetStorage : DataStorage
8{
10
12
17
18 public override object Aggregate(int[] records, AggregateType kind)
19 {
20 bool flag = false;
21 try
22 {
23 switch (kind)
24 {
25 case AggregateType.Min:
26 {
28 foreach (int num3 in records)
29 {
30 if (HasValue(num3))
31 {
33 flag = true;
34 }
35 }
36 if (flag)
37 {
38 return dateTimeOffset2;
39 }
40 return _nullValue;
41 }
42 case AggregateType.Max:
43 {
45 foreach (int num2 in records)
46 {
47 if (HasValue(num2))
48 {
50 flag = true;
51 }
52 }
53 if (flag)
54 {
55 return dateTimeOffset;
56 }
57 return _nullValue;
58 }
59 case AggregateType.First:
60 if (records.Length != 0)
61 {
62 return _values[records[0]];
63 }
64 return null;
65 case AggregateType.Count:
66 {
67 int num = 0;
68 for (int i = 0; i < records.Length; i++)
69 {
70 if (HasValue(records[i]))
71 {
72 num++;
73 }
74 }
75 return num;
76 }
77 }
78 }
79 catch (OverflowException)
80 {
82 }
84 }
85
86 public override int Compare(int recordNo1, int recordNo2)
87 {
91 {
93 if (num != 0)
94 {
95 return num;
96 }
97 }
99 }
100
101 public override int CompareValueTo(int recordNo, object value)
102 {
103 if (_nullValue == value)
104 {
105 if (!HasValue(recordNo))
106 {
107 return 0;
108 }
109 return 1;
110 }
113 {
114 return -1;
115 }
117 }
118
119 public override object ConvertValue(object value)
120 {
121 if (_nullValue != value)
122 {
123 value = ((value == null) ? _nullValue : ((object)(DateTimeOffset)value));
124 }
125 return value;
126 }
127
128 public override void Copy(int recordNo1, int recordNo2)
129 {
132 }
133
134 public override object Get(int record)
135 {
138 {
139 return dateTimeOffset;
140 }
141 return _nullValue;
142 }
143
144 public override void Set(int record, object value)
145 {
146 if (_nullValue == value)
147 {
149 SetNullBit(record, flag: true);
150 }
151 else
152 {
154 SetNullBit(record, flag: false);
155 }
156 }
157
158 public override void SetCapacity(int capacity)
159 {
161 if (_values != null)
162 {
164 }
165 _values = array;
166 base.SetCapacity(capacity);
167 }
168
169 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
170 public override object ConvertXmlToObject(string s)
171 {
173 }
174
175 [RequiresUnreferencedCode("Members from serialized types may be trimmed if not referenced directly.")]
176 public override string ConvertObjectToXml(object value)
177 {
179 }
180
181 protected override object GetEmptyStorage(int recordCount)
182 {
183 return new DateTimeOffset[recordCount];
184 }
185
186 protected override void CopyValue(int record, object store, BitArray nullbits, int storeIndex)
187 {
191 }
192
193 protected override void SetStorage(object store, BitArray nullbits)
194 {
197 }
198}
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
void SetNullStorage(BitArray nullbits)
int CompareBits(int recordNo1, int recordNo2)
bool HasValue(int recordNo)
void SetNullBit(int recordNo, bool flag)
void CopyBits(int srcRecordNo, int dstRecordNo)
override int CompareValueTo(int recordNo, object value)
override void Copy(int recordNo1, int recordNo2)
override void CopyValue(int record, object store, BitArray nullbits, int storeIndex)
override void Set(int record, object value)
override object GetEmptyStorage(int recordCount)
override string ConvertObjectToXml(object value)
override object Aggregate(int[] records, AggregateType kind)
override void SetStorage(object store, BitArray nullbits)
static readonly DateTimeOffset s_defaultValue
override int Compare(int recordNo1, int recordNo2)
static Exception AggregateException(AggregateType aggregateType, Type type)
static Exception Overflow(Type type)
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static DateTimeOffset ToDateTimeOffset(string s)
static string ToString(bool value)
static readonly DateTimeOffset MaxValue
static int Compare(DateTimeOffset first, DateTimeOffset second)
static readonly DateTimeOffset MinValue