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

◆ Eval() [2/3]

override object System.Data.AggregateNode.Eval ( DataRow row,
DataRowVersion version )
inlinepackage

Definition at line 148 of file AggregateNode.cs.

149 {
150 if (_childTable == null)
151 {
152 throw ExprException.AggregateUnbound(ToString());
153 }
154 DataRow[] array;
155 if (_local)
156 {
157 array = new DataRow[_childTable.Rows.Count];
159 }
160 else
161 {
162 if (row == null)
163 {
164 throw ExprException.EvalNoContext();
165 }
166 if (_relation == null)
167 {
168 throw ExprException.AggregateUnbound(ToString());
169 }
170 array = row.GetChildRows(_relation, version);
171 }
172 if (version == DataRowVersion.Proposed)
173 {
174 version = DataRowVersion.Default;
175 }
176 List<int> list = new List<int>();
177 for (int i = 0; i < array.Length; i++)
178 {
179 if (array[i].RowState == DataRowState.Deleted)
180 {
181 if (DataRowAction.Rollback != array[i]._action)
182 {
183 continue;
184 }
185 version = DataRowVersion.Original;
186 }
187 else if (DataRowAction.Rollback == array[i]._action && array[i].RowState == DataRowState.Added)
188 {
189 continue;
190 }
191 if (version != DataRowVersion.Original || array[i]._oldRecord != -1)
192 {
193 list.Add(array[i].GetRecordFromVersion(version));
194 }
195 }
196 int[] records = list.ToArray();
198 }
readonly AggregateType _type
object GetAggregateValue(int[] records, AggregateType kind)
override void CopyTo(Array ar, int index)
DataRowCollection Rows
Definition DataTable.cs:701

References System.Data.AggregateNode._childTable, System.Data.AggregateNode._column, System.Data.AggregateNode._local, System.Data.AggregateNode._relation, System.Data.AggregateNode._type, System.Data.ExprException.AggregateUnbound(), System.array, System.Data.DataRowCollection.CopyTo(), System.Data.DataRowCollection.Count, System.Data.ExprException.EvalNoContext(), System.Data.DataColumn.GetAggregateValue(), System.list, System.Data.DataTable.Rows, and System.ToString.