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

◆ DataView() [4/5]

System.Data.DataView.DataView ( DataTable table,
string? RowFilter,
string? Sort,
DataViewRowState RowState )
inline

Definition at line 488 of file DataView.cs.

489 {
490 GC.SuppressFinalize(this);
491 DataCommonEventSource.Log.Trace("<ds.DataView.DataView|API> {0}, table={1}, RowFilter='{2}', Sort='{3}', RowState={4}", ObjectID, table?.ObjectID ?? 0, RowFilter, Sort, RowState);
492 if (table == null)
493 {
494 throw ExceptionBuilder.CanNotUse();
495 }
496 _dvListener = new DataViewListener(this);
497 _locked = false;
498 _table = table;
500 if (((uint)RowState & 0xFFFFFFC1u) != 0)
501 {
502 throw ExceptionBuilder.RecordStateRange();
503 }
504 if ((RowState & DataViewRowState.ModifiedOriginal) != 0 && (RowState & DataViewRowState.ModifiedCurrent) != 0)
505 {
506 throw ExceptionBuilder.SetRowStateFilter();
507 }
508 if (Sort == null)
509 {
510 Sort = string.Empty;
511 }
512 if (RowFilter == null)
513 {
514 RowFilter = string.Empty;
515 }
516 DataExpression newRowFilter = new DataExpression(table, RowFilter);
517 SetIndex(Sort, RowState, newRowFilter);
518 }
void RegisterMetaDataEvents(DataTable table)
readonly DataViewListener _dvListener
Definition DataView.cs:106
virtual ? string RowFilter
Definition DataView.cs:202
virtual void SetIndex(string newSort, DataViewRowState newRowStates, IFilter newRowFilter)
Definition DataView.cs:1342

References System.Data.DataView._dvListener, System.Data.DataView._locked, System.Data.DataView._table, System.Data.ExceptionBuilder.CanNotUse(), System.Data.DataCommonEventSource.Log, System.Data.DataView.ObjectID, System.Data.ExceptionBuilder.RecordStateRange(), System.Data.DataViewListener.RegisterMetaDataEvents(), System.Data.DataView.RowFilter, System.Data.DataView.SetIndex(), System.Data.ExceptionBuilder.SetRowStateFilter(), System.Data.DataView.Sort, and System.GC.SuppressFinalize().