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

◆ GetLinqDataView()

LinqDataView System.Data.EnumerableRowCollection< TRow >.GetLinqDataView ( )
inlinepackageinherited

Definition at line 89 of file EnumerableRowCollection.cs.

90 {
91 if (_table == null || !typeof(DataRow).IsAssignableFrom(typeof(TRow)))
92 {
94 }
95 LinqDataView linqDataView = null;
97 if (_selector != null && 0 < _listOfPredicates.Count)
98 {
99 finalPredicate = delegate(DataRow row)
100 {
101 if (row != (object)_selector((TRow)(object)row))
102 {
104 }
106 {
107 if (!listOfPredicate((TRow)(object)row))
108 {
109 return false;
110 }
111 }
112 return true;
113 };
114 }
115 else if (_selector != null)
116 {
117 finalPredicate = delegate(DataRow row)
118 {
119 if (row != (object)_selector((TRow)(object)row))
120 {
122 }
123 return true;
124 };
125 }
126 else if (0 < _listOfPredicates.Count)
127 {
128 finalPredicate = delegate(DataRow row)
129 {
131 {
132 if (!listOfPredicate2((TRow)(object)row))
133 {
134 return false;
135 }
136 }
137 return true;
138 };
139 }
140 if (finalPredicate != null && 0 < _sortExpression.Count)
141 {
142 return new LinqDataView(_table, (DataRow row) => finalPredicate(row), (DataRow a, DataRow b) => _sortExpression.Compare(_sortExpression.Select((TRow)(object)a), _sortExpression.Select((TRow)(object)b)), (object key, DataRow row) => _sortExpression.Compare((List<object>)key, _sortExpression.Select((TRow)(object)row)), _sortExpression.CloneCast<DataRow>());
143 }
144 if (finalPredicate != null)
145 {
146 return new LinqDataView(_table, (DataRow row) => finalPredicate(row), null, null, _sortExpression.CloneCast<DataRow>());
147 }
148 if (0 < _sortExpression.Count)
149 {
150 return new LinqDataView(_table, null, (DataRow a, DataRow b) => _sortExpression.Compare(_sortExpression.Select((TRow)(object)a), _sortExpression.Select((TRow)(object)b)), (object key, DataRow row) => _sortExpression.Compare((List<object>)key, _sortExpression.Select((TRow)(object)row)), _sortExpression.CloneCast<DataRow>());
151 }
152 return new LinqDataView(_table, _sortExpression.CloneCast<DataRow>());
153 }
static NotSupportedException NotSupported(string message)
readonly SortExpressionBuilder< TRow > _sortExpression
readonly List< Func< TRow, bool > > _listOfPredicates
int Compare(List< object > a, List< object > b)
static string ToLDVUnsupported
Definition SR.cs:924
Definition SR.cs:7

References System.Data.EnumerableRowCollection< TRow >._listOfPredicates, System.Data.EnumerableRowCollection< TRow >._selector, System.Data.EnumerableRowCollection< TRow >._sortExpression, System.Data.EnumerableRowCollection< TRow >._table, System.Data.SortExpressionBuilder< T >.Compare(), System.Data.SortExpressionBuilder< T >.Count, System.Collections.Generic.List< T >.Count, System.key, DataSetUtil.NotSupported(), System.Data.SortExpressionBuilder< T >.Select(), and System.SR.ToLDVUnsupported.