Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DataRow.cs
Go to the documentation of this file.
6using System.Xml;
7
8namespace System.Data;
9
10public class DataRow
11{
12 private readonly DataTable _table;
13
15
16 internal int _oldRecord = -1;
17
18 internal int _newRecord = -1;
19
20 internal int _tempRecord;
21
22 internal long _rowID = -1L;
23
25
26 internal bool _inChangingEvent;
27
28 internal bool _inDeletingEvent;
29
30 internal bool _inCascade;
31
33
34 private int _countColumnChange;
35
37
38 private object _element;
39
40 private int _rbTreeNodeId;
41
42 private static int s_objectTypeCount;
43
45
47 {
48 get
49 {
51 }
52 set
53 {
55 }
56 }
57
59 {
60 get
61 {
62 if (_countColumnChange == 1)
63 {
64 return _lastChangedColumn;
65 }
66 return null;
67 }
68 set
69 {
72 }
73 }
74
76
77 internal int RBTreeNodeId
78 {
79 get
80 {
81 return _rbTreeNodeId;
82 }
83 set
84 {
85 DataCommonEventSource.Log.Trace("<ds.DataRow.set_RBTreeNodeId|INFO> {0}, value={1}", _objectID, value);
87 }
88 }
89
90 public string RowError
91 {
92 get
93 {
94 if (_error != null)
95 {
96 return _error.Text;
97 }
98 return string.Empty;
99 }
101 set
102 {
103 DataCommonEventSource.Log.Trace("<ds.DataRow.set_RowError|API> {0}, value='{1}'", _objectID, value);
104 if (_error == null)
105 {
106 if (!string.IsNullOrEmpty(value))
107 {
108 _error = new DataError(value);
109 }
111 }
112 else if (_error.Text != value)
113 {
116 }
117 }
118 }
119
120 internal long rowID
121 {
122 get
123 {
124 return _rowID;
125 }
126 set
127 {
129 _rowID = value;
130 }
131 }
132
134 {
135 get
136 {
137 if (_oldRecord == _newRecord)
138 {
139 if (_oldRecord == -1)
140 {
141 return DataRowState.Detached;
142 }
144 {
147 {
148 object obj = this[column];
149 if (DBNull.Value != obj && ((IChangeTracking)obj).IsChanged)
150 {
151 return DataRowState.Modified;
152 }
153 }
154 }
155 return DataRowState.Unchanged;
156 }
157 if (_oldRecord == -1)
158 {
159 return DataRowState.Added;
160 }
161 if (_newRecord == -1)
162 {
163 return DataRowState.Deleted;
164 }
165 return DataRowState.Modified;
166 }
167 }
168
170
171 public object this[int columnIndex]
172 {
173 get
174 {
178 }
180 set
181 {
183 this[column] = value;
184 }
185 }
186
187 public object this[string columnName]
188 {
189 get
190 {
194 }
196 set
197 {
199 this[dataColumn] = value;
200 }
201 }
202
203 public object this[DataColumn column]
204 {
205 get
206 {
209 return column[defaultRecord];
210 }
212 set
213 {
216 {
218 }
219 if (-1 != rowID && column.ReadOnly)
220 {
221 throw ExceptionBuilder.ReadOnly(column.ColumnName);
222 }
225 {
228 }
229 if (column.Table != _table)
230 {
232 }
233 if (-1 != rowID && column.ReadOnly)
234 {
235 throw ExceptionBuilder.ReadOnly(column.ColumnName);
236 }
237 object obj = ((dataColumnChangeEventArgs != null) ? dataColumnChangeEventArgs.ProposedValue : value);
238 if (obj == null)
239 {
240 if (column.IsValueType)
241 {
243 }
244 obj = DBNull.Value;
245 }
246 bool flag = BeginEditInternal();
247 try
248 {
251 }
253 {
254 if (flag)
255 {
256 CancelEdit();
257 }
258 throw;
259 }
261 if (dataColumnChangeEventArgs != null)
262 {
264 }
265 if (flag)
266 {
267 EndEdit();
268 }
269 }
270 }
271
272 public object this[int columnIndex, DataRowVersion version]
273 {
274 get
275 {
279 }
280 }
281
282 public object this[string columnName, DataRowVersion version]
283 {
284 get
285 {
289 }
290 }
291
292 public object this[DataColumn column, DataRowVersion version]
293 {
294 get
295 {
299 }
300 }
301
302 public object?[] ItemArray
303 {
304 get
305 {
307 object[] array = new object[_columns.Count];
308 for (int i = 0; i < array.Length; i++)
309 {
312 }
313 return array;
314 }
315 set
316 {
317 if (value == null)
318 {
319 throw ExceptionBuilder.ArgumentNull("ItemArray");
320 }
321 if (_columns.Count < value.Length)
322 {
324 }
327 {
329 }
330 bool flag = BeginEditInternal();
331 for (int i = 0; i < value.Length; i++)
332 {
333 object obj = value[i];
334 if (obj == null)
335 {
336 continue;
337 }
339 if (-1 != rowID && dataColumn.ReadOnly)
340 {
341 throw ExceptionBuilder.ReadOnly(dataColumn.ColumnName);
342 }
343 if (dataColumnChangeEventArgs != null)
344 {
345 dataColumnChangeEventArgs.InitializeColumnChangeEvent(dataColumn, obj);
347 }
348 if (dataColumn.Table != _table)
349 {
351 }
352 if (-1 != rowID && dataColumn.ReadOnly)
353 {
354 throw ExceptionBuilder.ReadOnly(dataColumn.ColumnName);
355 }
356 if (_tempRecord == -1)
357 {
359 }
360 object obj2 = ((dataColumnChangeEventArgs != null) ? dataColumnChangeEventArgs.ProposedValue : obj);
361 if (obj2 == null)
362 {
363 if (dataColumn.IsValueType)
364 {
366 }
367 obj2 = DBNull.Value;
368 }
369 try
370 {
373 }
375 {
376 if (flag)
377 {
378 CancelEdit();
379 }
380 throw;
381 }
383 if (dataColumnChangeEventArgs != null)
384 {
386 }
387 }
388 EndEdit();
389 }
390 }
391
392 public bool HasErrors
393 {
394 get
395 {
396 if (_error != null)
397 {
398 return _error.HasErrors;
399 }
400 return false;
401 }
402 }
403
404 protected internal DataRow(DataRowBuilder builder)
405 {
406 _tempRecord = builder._record;
407 _table = builder._table;
409 }
410
411 private void RowErrorChanged()
412 {
413 if (_oldRecord != -1)
414 {
416 }
417 if (_newRecord != -1)
418 {
420 }
421 }
422
424 {
426 {
427 return;
428 }
429 int count = _table.Rows.Count;
430 int num = 0;
432 {
433 if (parentRow == this || num > count)
434 {
436 }
437 num++;
438 }
439 }
440
441 internal int GetNestedParentCount()
442 {
443 int num = 0;
446 foreach (DataRelation dataRelation in array)
447 {
448 if (dataRelation != null)
449 {
450 if (dataRelation.ParentTable == _table)
451 {
453 }
455 if (parentRow != null)
456 {
457 num++;
458 }
459 }
460 }
461 return num;
462 }
463
464 public void AcceptChanges()
465 {
466 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataRow.AcceptChanges|API> {0}", _objectID);
467 try
468 {
469 EndEdit();
471 {
474 {
475 object obj = this[column];
476 if (DBNull.Value != obj)
477 {
479 if (changeTracking.IsChanged)
480 {
482 }
483 }
484 }
485 }
486 _table.CommitRow(this);
487 }
488 finally
489 {
490 DataCommonEventSource.Log.ExitScope(scopeId);
491 }
492 }
493
495 public void BeginEdit()
496 {
498 }
499
500 private bool BeginEditInternal()
501 {
503 {
505 }
506 if (_tempRecord != -1)
507 {
509 {
510 return false;
511 }
512 _tempRecord = -1;
513 }
514 if (_oldRecord != -1 && _newRecord == -1)
515 {
517 }
520 return true;
521 }
522
524 public void CancelEdit()
525 {
527 {
529 }
532 }
533
535 {
536 if (column == null)
537 {
538 throw ExceptionBuilder.ArgumentNull("column");
539 }
540 if (column.Table != _table)
541 {
543 }
544 }
545
546 internal void CheckInTable()
547 {
548 if (rowID == -1)
549 {
551 }
552 }
553
554 public void Delete()
555 {
557 {
559 }
560 if (_newRecord != -1)
561 {
562 _table.DeleteRow(this);
563 }
564 }
565
567 public void EndEdit()
568 {
570 {
572 }
573 if (_newRecord == -1 || _tempRecord == -1)
574 {
575 return;
576 }
577 try
578 {
580 }
581 finally
582 {
584 }
585 }
586
587 public void SetColumnError(int columnIndex, string? error)
588 {
590 if (dataColumn == null)
591 {
593 }
595 }
596
602
603 public void SetColumnError(DataColumn column, string? error)
604 {
606 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataRow.SetColumnError|API> {0}, column={1}, error='{2}'", _objectID, column.ObjectID, error);
607 try
608 {
609 if (_error == null)
610 {
611 _error = new DataError();
612 }
614 {
617 }
618 }
619 finally
620 {
621 DataCommonEventSource.Log.ExitScope(scopeId);
622 }
623 }
624
625 public string GetColumnError(int columnIndex)
626 {
628 }
629
630 public string GetColumnError(string columnName)
631 {
633 }
634
636 {
638 if (_error == null)
639 {
640 _error = new DataError();
641 }
643 }
644
645 public void ClearErrors()
646 {
647 if (_error != null)
648 {
649 _error.Clear();
651 }
652 }
653
655 {
656 if (_error != null)
657 {
660 }
661 }
662
664 {
665 if (_error != null)
666 {
667 return _error.GetColumnsInError();
668 }
669 return Array.Empty<DataColumn>();
670 }
671
673 {
675 }
676
678 {
680 }
681
683 {
684 return GetChildRows(relation, DataRowVersion.Default);
685 }
686
688 {
689 if (relation == null)
690 {
691 return _table.NewRowArray(0);
692 }
693 if (relation.DataSet != _table.DataSet)
694 {
696 }
697 if (relation.ParentKey.Table != _table)
698 {
699 throw ExceptionBuilder.RelationForeignTable(relation.ParentTable.TableName, _table.TableName);
700 }
701 return DataRelation.GetChildRows(relation.ParentKey, relation.ChildKey, this, version);
702 }
703
705 {
707 if (dataColumn != null)
708 {
709 return dataColumn;
710 }
712 }
713
718
720 {
722 }
723
725 {
726 return GetParentRow(relation, DataRowVersion.Default);
727 }
728
730 {
731 if (relation == null)
732 {
733 return null;
734 }
735 if (relation.DataSet != _table.DataSet)
736 {
738 }
739 if (relation.ChildKey.Table != _table)
740 {
742 }
743 return DataRelation.GetParentRow(relation.ParentKey, relation.ChildKey, this, version);
744 }
745
747 {
750 foreach (DataRelation dataRelation in array)
751 {
752 if (dataRelation != null)
753 {
754 if (dataRelation.ParentTable == _table)
755 {
757 }
759 if (parentRow != null)
760 {
761 return parentRow;
762 }
763 }
764 }
765 return null;
766 }
767
772
774 {
776 }
777
779 {
780 return GetParentRows(relation, DataRowVersion.Default);
781 }
782
784 {
785 if (relation == null)
786 {
787 return _table.NewRowArray(0);
788 }
789 if (relation.DataSet != _table.DataSet)
790 {
792 }
793 if (relation.ChildKey.Table != _table)
794 {
796 }
797 return DataRelation.GetParentRows(relation.ParentKey, relation.ChildKey, this, version);
798 }
799
800 internal object[] GetColumnValues(DataColumn[] columns)
801 {
802 return GetColumnValues(columns, DataRowVersion.Default);
803 }
804
805 internal object[] GetColumnValues(DataColumn[] columns, DataRowVersion version)
806 {
807 DataKey key = new DataKey(columns, copyColumns: false);
808 return GetKeyValues(key, version);
809 }
810
811 internal object[] GetKeyValues(DataKey key)
812 {
814 return key.GetKeyValues(defaultRecord);
815 }
816
817 internal object[] GetKeyValues(DataKey key, DataRowVersion version)
818 {
820 return key.GetKeyValues(recordFromVersion);
821 }
822
823 internal int GetCurrentRecordNo()
824 {
825 if (_newRecord == -1)
826 {
828 }
829 return _newRecord;
830 }
831
832 internal int GetDefaultRecord()
833 {
834 if (_tempRecord != -1)
835 {
836 return _tempRecord;
837 }
838 if (_newRecord != -1)
839 {
840 return _newRecord;
841 }
843 }
844
845 internal int GetOriginalRecordNo()
846 {
847 if (_oldRecord == -1)
848 {
850 }
851 return _oldRecord;
852 }
853
855 {
856 if (_tempRecord == -1)
857 {
859 }
860 return _tempRecord;
861 }
862
874
876 {
877 if (_oldRecord == _newRecord)
878 {
879 _ = _oldRecord;
880 _ = -1;
881 return DataRowVersion.Default;
882 }
883 if (_oldRecord == -1)
884 {
885 return DataRowVersion.Default;
886 }
887 if (_newRecord == -1)
888 {
889 return DataRowVersion.Original;
890 }
891 if ((DataViewRowState.ModifiedCurrent & viewState) != 0)
892 {
893 return DataRowVersion.Default;
894 }
895 return DataRowVersion.Original;
896 }
897
899 {
900 if (record == -1)
901 {
902 return DataViewRowState.None;
903 }
904 if (record == _oldRecord && record == _newRecord)
905 {
906 return DataViewRowState.Unchanged;
907 }
908 if (record == _oldRecord)
909 {
910 if (_newRecord == -1)
911 {
912 return DataViewRowState.Deleted;
913 }
914 return DataViewRowState.ModifiedOriginal;
915 }
916 if (record == _newRecord)
917 {
918 if (_oldRecord == -1)
919 {
920 return DataViewRowState.Added;
921 }
922 return DataViewRowState.ModifiedCurrent;
923 }
924 return DataViewRowState.None;
925 }
926
927 internal bool HasKeyChanged(DataKey key)
928 {
929 return HasKeyChanged(key, DataRowVersion.Current, DataRowVersion.Proposed);
930 }
931
933 {
935 {
936 return true;
937 }
939 }
940
941 public bool HasVersion(DataRowVersion version)
942 {
943 return version switch
944 {
950 };
951 }
952
953 internal bool HasChanges()
954 {
955 if (!HasVersion(DataRowVersion.Original) || !HasVersion(DataRowVersion.Current))
956 {
957 return true;
958 }
959 foreach (DataColumn column in Table.Columns)
960 {
961 if (column.Compare(_oldRecord, _newRecord) != 0)
962 {
963 return true;
964 }
965 }
966 return false;
967 }
968
970 {
971 return HaveValuesChanged(columns, DataRowVersion.Current, DataRowVersion.Proposed);
972 }
973
975 {
976 for (int i = 0; i < columns.Length; i++)
977 {
979 }
980 DataKey key = new DataKey(columns, copyColumns: false);
982 }
983
984 public bool IsNull(int columnIndex)
985 {
988 return dataColumn.IsNull(defaultRecord);
989 }
990
991 public bool IsNull(string columnName)
992 {
995 return dataColumn.IsNull(defaultRecord);
996 }
997
999 {
1002 return column.IsNull(defaultRecord);
1003 }
1004
1006 {
1009 return column.IsNull(recordFromVersion);
1010 }
1011
1012 public void RejectChanges()
1013 {
1014 long scopeId = DataCommonEventSource.Log.EnterScope("<ds.DataRow.RejectChanges|API> {0}", _objectID);
1015 try
1016 {
1017 if (RowState != DataRowState.Detached)
1018 {
1020 {
1023 {
1024 if (!dataColumn.ImplementsIRevertibleChangeTracking)
1025 {
1026 object obj = null;
1027 obj = ((RowState == DataRowState.Deleted) ? this[dataColumn, DataRowVersion.Original] : this[dataColumn]);
1028 if (DBNull.Value != obj && ((IChangeTracking)obj).IsChanged)
1029 {
1031 }
1032 }
1033 }
1034 }
1037 {
1038 object obj2 = null;
1039 obj2 = ((RowState == DataRowState.Deleted) ? this[column, DataRowVersion.Original] : this[column]);
1040 if (DBNull.Value != obj2)
1041 {
1043 if (changeTracking.IsChanged)
1044 {
1045 ((IRevertibleChangeTracking)obj2).RejectChanges();
1046 }
1047 }
1048 }
1049 }
1050 _table.RollbackRow(this);
1051 }
1052 finally
1053 {
1054 DataCommonEventSource.Log.ExitScope(scopeId);
1055 }
1056 }
1057
1059 {
1060 _lastChangedColumn = null;
1062 }
1063
1064 internal void SetKeyValues(DataKey key, object[] keyValues)
1065 {
1066 bool flag = true;
1067 bool flag2 = _tempRecord == -1;
1068 for (int i = 0; i < keyValues.Length; i++)
1069 {
1070 object obj = this[key.ColumnsReference[i]];
1071 if (!obj.Equals(keyValues[i]))
1072 {
1073 if (flag2 && flag)
1074 {
1075 flag = false;
1077 }
1078 this[key.ColumnsReference[i]] = keyValues[i];
1079 }
1080 }
1081 if (!flag)
1082 {
1083 EndEdit();
1084 }
1085 }
1086
1087 protected void SetNull(DataColumn column)
1088 {
1089 this[column] = DBNull.Value;
1090 }
1091
1093 {
1094 if (parentRow == null)
1095 {
1097 return;
1098 }
1100 {
1101 if (!(parentRelation.Nested || setNonNested) || parentRelation.ParentKey.Table != parentRow._table)
1102 {
1103 continue;
1104 }
1105 object[] keyValues = parentRow.GetKeyValues(parentRelation.ParentKey);
1107 if (parentRelation.Nested)
1108 {
1109 if (parentRow._table == _table)
1110 {
1112 }
1113 else
1114 {
1116 }
1117 }
1118 }
1119 }
1120
1122 {
1124 }
1125
1127 {
1128 if (relation == null)
1129 {
1131 return;
1132 }
1133 if (parentRow == null)
1134 {
1136 return;
1137 }
1138 if (_table.DataSet != parentRow._table.DataSet)
1139 {
1141 }
1142 if (relation.ChildKey.Table != _table)
1143 {
1144 throw ExceptionBuilder.SetParentRowTableMismatch(relation.ChildKey.Table.TableName, _table.TableName);
1145 }
1146 if (relation.ParentKey.Table != parentRow._table)
1147 {
1148 throw ExceptionBuilder.SetParentRowTableMismatch(relation.ParentKey.Table.TableName, parentRow._table.TableName);
1149 }
1150 object[] keyValues = parentRow.GetKeyValues(relation.ParentKey);
1151 SetKeyValues(relation.ChildKey, keyValues);
1152 }
1153
1154 internal void SetParentRowToDBNull()
1155 {
1157 {
1159 }
1160 }
1161
1163 {
1164 if (relation.ChildKey.Table != _table)
1165 {
1166 throw ExceptionBuilder.SetParentRowTableMismatch(relation.ChildKey.Table.TableName, _table.TableName);
1167 }
1168 SetKeyValues(keyValues: new object[1] { DBNull.Value }, key: relation.ChildKey);
1169 }
1170
1171 public void SetAdded()
1172 {
1173 if (RowState == DataRowState.Unchanged)
1174 {
1175 _table.SetOldRecord(this, -1);
1176 return;
1177 }
1179 }
1180
1181 public void SetModified()
1182 {
1183 if (RowState == DataRowState.Unchanged)
1184 {
1186 if (_tempRecord != -1)
1187 {
1189 }
1190 return;
1191 }
1193 }
1194
1196 {
1197 int num = 0;
1198 if (_oldRecord != -1)
1199 {
1200 for (int i = 0; i < _columns.Count; i++)
1201 {
1202 _columns[i].CopyValueIntoStore(_oldRecord, storeList[i], (BitArray)nullbitList[i], storeIndex);
1203 }
1204 num++;
1205 storeIndex++;
1206 }
1208 if (DataRowState.Added == rowState || DataRowState.Modified == rowState)
1209 {
1210 for (int j = 0; j < _columns.Count; j++)
1211 {
1212 _columns[j].CopyValueIntoStore(_newRecord, storeList[j], (BitArray)nullbitList[j], storeIndex);
1213 }
1214 num++;
1215 storeIndex++;
1216 }
1217 if (-1 != _tempRecord)
1218 {
1219 for (int k = 0; k < _columns.Count; k++)
1220 {
1221 _columns[k].CopyValueIntoStore(_tempRecord, storeList[k], (BitArray)nullbitList[k], storeIndex);
1222 }
1223 num++;
1224 storeIndex++;
1225 }
1226 return num;
1227 }
1228}
static readonly DBNull Value
Definition DBNull.cs:8
static bool IsCatchableOrSecurityExceptionType(Exception e)
Definition ADP.cs:800
static readonly DataCommonEventSource Log
string GetColumnError(DataColumn column)
Definition DataError.cs:75
void SetColumnError(DataColumn column, string error)
Definition DataError.cs:54
void Clear(DataColumn column)
Definition DataError.cs:87
DataColumn[] GetColumnsInError()
Definition DataError.cs:114
static DataRow[] GetChildRows(DataKey parentKey, DataKey childKey, DataRow parentRow, DataRowVersion version)
static DataRow[] GetParentRows(DataKey parentKey, DataKey childKey, DataRow childRow, DataRowVersion version)
static DataRow GetParentRow(DataKey parentKey, DataKey childKey, DataRow childRow, DataRowVersion version)
int GetNestedParentCount()
Definition DataRow.cs:441
string GetColumnError(int columnIndex)
Definition DataRow.cs:625
readonly DataColumnCollection _columns
Definition DataRow.cs:14
void ClearError(DataColumn column)
Definition DataRow.cs:654
DataRow[] GetParentRows(string? relationName, DataRowVersion version)
Definition DataRow.cs:773
DataRow[] GetParentRows(DataRelation? relation)
Definition DataRow.cs:778
DataRow[] GetChildRows(string? relationName)
Definition DataRow.cs:672
bool HasKeyChanged(DataKey key)
Definition DataRow.cs:927
bool HaveValuesChanged(DataColumn[] columns, DataRowVersion version1, DataRowVersion version2)
Definition DataRow.cs:974
DataRow? GetParentRow(DataRelation? relation, DataRowVersion version)
Definition DataRow.cs:729
void CheckForLoops(DataRelation rel)
Definition DataRow.cs:423
bool HasPropertyChanged
Definition DataRow.cs:75
object[] GetColumnValues(DataColumn[] columns, DataRowVersion version)
Definition DataRow.cs:805
bool HasVersion(DataRowVersion version)
Definition DataRow.cs:941
DataRowAction _action
Definition DataRow.cs:24
int GetRecordFromVersion(DataRowVersion version)
Definition DataRow.cs:863
object[] GetKeyValues(DataKey key)
Definition DataRow.cs:811
DataColumn _lastChangedColumn
Definition DataRow.cs:32
bool IsNull(DataColumn column)
Definition DataRow.cs:998
void SetColumnError(string columnName, string? error)
Definition DataRow.cs:597
static int s_objectTypeCount
Definition DataRow.cs:42
string GetColumnError(string columnName)
Definition DataRow.cs:630
bool IsNull(DataColumn column, DataRowVersion version)
Definition DataRow.cs:1005
object?[] ItemArray
Definition DataRow.cs:303
int CopyValuesIntoStore(ArrayList storeList, ArrayList nullbitList, int storeIndex)
Definition DataRow.cs:1195
DataRow[] GetParentRows(string? relationName)
Definition DataRow.cs:768
void SetParentRow(DataRow? parentRow)
Definition DataRow.cs:1121
int GetCurrentRecordNo()
Definition DataRow.cs:823
string GetColumnError(DataColumn column)
Definition DataRow.cs:635
bool IsNull(string columnName)
Definition DataRow.cs:991
object[] GetKeyValues(DataKey key, DataRowVersion version)
Definition DataRow.cs:817
DataRow GetNestedParentRow(DataRowVersion version)
Definition DataRow.cs:746
DataRow[] GetChildRows(DataRelation? relation, DataRowVersion version)
Definition DataRow.cs:687
void SetParentRowToDBNull(DataRelation relation)
Definition DataRow.cs:1162
DataViewRowState GetRecordState(int record)
Definition DataRow.cs:898
void SetColumnError(int columnIndex, string? error)
Definition DataRow.cs:587
DataRow[] GetChildRows(string? relationName, DataRowVersion version)
Definition DataRow.cs:677
void SetColumnError(DataColumn column, string? error)
Definition DataRow.cs:603
bool BeginEditInternal()
Definition DataRow.cs:500
DataTable Table
Definition DataRow.cs:169
void SetParentRow(DataRow? parentRow, DataRelation? relation)
Definition DataRow.cs:1126
DataError _error
Definition DataRow.cs:36
XmlBoundElement? Element
Definition DataRow.cs:47
DataColumn GetDataColumn(string columnName)
Definition DataRow.cs:704
void ResetLastChangedColumn()
Definition DataRow.cs:1058
void SetKeyValues(DataKey key, object[] keyValues)
Definition DataRow.cs:1064
void RowErrorChanged()
Definition DataRow.cs:411
bool HaveValuesChanged(DataColumn[] columns)
Definition DataRow.cs:969
DataRowState RowState
Definition DataRow.cs:134
DataColumn[] GetColumnsInError()
Definition DataRow.cs:663
readonly int _objectID
Definition DataRow.cs:44
bool IsNull(int columnIndex)
Definition DataRow.cs:984
DataRow? GetParentRow(string? relationName)
Definition DataRow.cs:714
void SetParentRowToDBNull()
Definition DataRow.cs:1154
DataRow? GetParentRow(DataRelation? relation)
Definition DataRow.cs:724
void SetNull(DataColumn column)
Definition DataRow.cs:1087
DataRow? GetParentRow(string? relationName, DataRowVersion version)
Definition DataRow.cs:719
DataColumn? LastChangedColumn
Definition DataRow.cs:59
void SetNestedParentRow(DataRow parentRow, bool setNonNested)
Definition DataRow.cs:1092
DataRow[] GetParentRows(DataRelation? relation, DataRowVersion version)
Definition DataRow.cs:783
int GetProposedRecordNo()
Definition DataRow.cs:854
int GetOriginalRecordNo()
Definition DataRow.cs:845
DataRow[] GetChildRows(DataRelation? relation)
Definition DataRow.cs:682
bool HasKeyChanged(DataKey key, DataRowVersion version1, DataRowVersion version2)
Definition DataRow.cs:932
readonly DataTable _table
Definition DataRow.cs:12
void CheckColumn(DataColumn column)
Definition DataRow.cs:534
DataRowVersion GetDefaultRowVersion(DataViewRowState viewState)
Definition DataRow.cs:875
DataRow(DataRowBuilder builder)
Definition DataRow.cs:404
object[] GetColumnValues(DataColumn[] columns)
Definition DataRow.cs:800
DataRowCollection Rows
Definition DataTable.cs:701
virtual void OnColumnChanged(DataColumnChangeEventArgs e)
virtual void OnColumnChanging(DataColumnChangeEventArgs e)
void FreeRecord(ref int record)
DataColumnCollection Columns
Definition DataTable.cs:327
void RecordChanged(int record)
DataRow[] NewRowArray(int size)
void SetOldRecord(DataRow row, int proposedRecord)
DataRelationCollection ParentRelations
Definition DataTable.cs:572
void CommitRow(DataRow row)
void DeleteRow(DataRow row)
void RollbackRow(DataRow row)
void SetNewRecord(DataRow row, int proposedRecord, DataRowAction action=DataRowAction.Change, bool isInMerge=false, bool fireEvent=true, bool suppressEnsurePropertyChanged=false)
readonly RecordManager _recordManager
Definition DataTable.cs:74
DataRelation[] NestedParentRelations
Definition DataTable.cs:586
DataRelationCollection ChildRelations
Definition DataTable.cs:324
static Exception ColumnOutOfRange(int index)
static Exception DeletedRowInaccessible()
static Exception EditInRowChanging()
static Exception RowRemovedFromTheTable()
static Exception GetParentRowTableMismatch(string t1, string t2)
static Exception DeleteInRowDeleting()
static Exception EndEditInRowChanging()
static Exception ValueArrayLength()
static Exception NoProposedData()
static Exception ParentRowNotInTheDataSet()
static Exception SetAddedAndModifiedCalledOnnonUnchanged()
static Exception RowNotInTheTable()
static Exception SetParentRowTableMismatch(string t1, string t2)
static Exception BeginEditInRowChanging()
static Exception RowNotInTheDataSet()
static Exception NestedCircular(string name)
static Exception RelationForeignRow()
static Exception CannotSetToNull(DataColumn column)
static Exception ColumnNotInTheTable(string column, string table)
static Exception RelationForeignTable(string t1, string t2)
static Exception CancelEditInRowChanging()
static Exception NoOriginalData()
static Exception ReadOnly(string column)
static Exception InvalidRowVersion()
static Exception UDTImplementsIChangeTrackingButnotIRevertible(string typeName)
static Exception ArgumentNull(string paramName)
static int Increment(ref int location)