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

◆ RecordStateChanged() [1/2]

void System.Data.Index.RecordStateChanged ( int oldRecord,
DataViewRowState oldOldState,
DataViewRowState oldNewState,
int newRecord,
DataViewRowState newOldState,
DataViewRowState newNewState )
inline

Definition at line 816 of file Index.cs.

817 {
818 DataCommonEventSource.Log.Trace("<ds.Index.RecordStateChanged|API> {0}, oldRecord={1}, oldOldState={2}, oldNewState={3}, newRecord={4}, newOldState={5}, newNewState={6}", ObjectID, oldRecord, oldOldState, oldNewState, newRecord, newOldState, newNewState);
821 if (changeAction == -1 && changeAction2 == 1 && AcceptRecord(newRecord))
822 {
824 if (_comparison == null && num != -1 && CompareRecords(oldRecord, newRecord) == 0)
825 {
827 int index = GetIndex(newRecord);
829 return;
830 }
831 _suspendEvents = true;
832 if (num != -1)
833 {
835 _recordCount--;
836 }
838 _recordCount++;
839 _suspendEvents = false;
841 if (num == index2)
842 {
843 OnListChanged(ListChangedType.ItemChanged, index2, num);
844 }
845 else if (num == -1)
846 {
849 }
850 else
851 {
852 OnListChanged(ListChangedType.ItemMoved, index2, num);
853 }
854 }
855 else
856 {
859 }
860 }
void ApplyChangeAction(int record, int action, int changeRecord)
Definition Index.cs:236
void OnListChanged(ListChangedType changedType, int newIndex, int oldIndex)
Definition Index.cs:731
int GetIndex(int record)
Definition Index.cs:371
bool AcceptRecord(int record)
Definition Index.cs:153
static int GetReplaceAction(DataViewRowState oldState)
Definition Index.cs:593
int CompareRecords(int record1, int record2)
Definition Index.cs:264
void MaintainDataView(ListChangedType changedType, int record, bool trackAddRemove)
Definition Index.cs:756
IndexTree _records
Definition Index.cs:42
bool _suspendEvents
Definition Index.cs:50
readonly Comparison< DataRow > _comparison
Definition Index.cs:36
int GetChangeAction(DataViewRowState oldState, DataViewRowState newState)
Definition Index.cs:586
K DeleteByIndex(int i)
Definition RBTree.cs:746
void UpdateNodeKey(K currentKey, K newKey)
Definition RBTree.cs:736
int Insert(K item)
Definition RBTree.cs:1218

References System.Data.Index._comparison, System.Data.Index._recordCount, System.Data.Index._records, System.Data.Index._suspendEvents, System.Data.Index.AcceptRecord(), System.Data.Index.ApplyChangeAction(), System.Data.Index.CompareRecords(), System.Data.RBTree< K >.DeleteByIndex(), System.Data.Index.GetChangeAction(), System.Data.Index.GetIndex(), System.Data.Index.GetReplaceAction(), System.index, System.index2, System.Data.RBTree< K >.Insert(), System.Data.DataCommonEventSource.Log, System.Data.Index.MaintainDataView(), System.Data.Index.ObjectID, System.Data.Index.OnListChanged(), and System.Data.RBTree< K >.UpdateNodeKey().