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

◆ Aggregate()

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

Reimplemented from System.Data.Common.DataStorage.

Definition at line 19 of file SqlBooleanStorage.cs.

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 flag = true;
35 }
36 }
37 if (flag)
38 {
39 return sqlBoolean2;
40 }
41 return _nullValue;
42 }
43 case AggregateType.Max:
44 {
45 SqlBoolean sqlBoolean = false;
46 foreach (int num2 in records)
47 {
48 if (!IsNull(num2))
49 {
51 flag = true;
52 }
53 }
54 if (flag)
55 {
56 return sqlBoolean;
57 }
58 return _nullValue;
59 }
60 case AggregateType.First:
61 if (records.Length != 0)
62 {
63 return _values[records[0]];
64 }
65 return _nullValue;
66 case AggregateType.Count:
67 {
68 int num = 0;
69 for (int i = 0; i < records.Length; i++)
70 {
71 if (!IsNull(records[i]))
72 {
73 num++;
74 }
75 }
76 return num;
77 }
78 }
79 }
80 catch (OverflowException)
81 {
82 throw ExprException.Overflow(typeof(SqlBoolean));
83 }
84 throw ExceptionBuilder.AggregateException(kind, _dataType);
85 }
static SqlBoolean And(SqlBoolean x, SqlBoolean y)
static SqlBoolean Or(SqlBoolean x, SqlBoolean y)

References System.Data.Common.DataStorage._dataType, System.Data.Common.DataStorage._nullValue, System.Data.Common.SqlBooleanStorage._values, System.Data.ExceptionBuilder.AggregateException(), System.Data.SqlTypes.SqlBoolean.And(), System.Xml.Dictionary, System.Data.IsNull, System.Data.SqlTypes.SqlBoolean.Or(), and System.Data.ExprException.Overflow().