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

◆ Aggregate()

override object System.Data.Common.DateTimeOffsetStorage.Aggregate ( int[] records,
AggregateType kind )
inlinevirtual

Reimplemented from System.Data.Common.DataStorage.

Definition at line 18 of file DateTimeOffsetStorage.cs.

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 {
81 throw ExprException.Overflow(typeof(DateTimeOffset));
82 }
83 throw ExceptionBuilder.AggregateException(kind, _dataType);
84 }
bool HasValue(int recordNo)

References System.Data.Common.DataStorage._dataType, System.Data.Common.DataStorage._nullValue, System.Data.Common.DateTimeOffsetStorage._values, System.Data.ExceptionBuilder.AggregateException(), System.DateTimeOffset.Compare(), System.Xml.Dictionary, System.Data.Common.DataStorage.HasValue(), System.DateTimeOffset.MaxValue, System.DateTimeOffset.MinValue, and System.Data.ExprException.Overflow().