You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
40
mcs/class/System.Data/corefx/DataView.cs
Normal file
40
mcs/class/System.Data/corefx/DataView.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
namespace System.Data
|
||||
{
|
||||
partial class DataView
|
||||
{
|
||||
/// <summary>
|
||||
/// Allow construction of DataView with <see cref="System.Predicate<DataRow>"/> and <see cref="System.Comparison<DataRow>"/>
|
||||
/// </summary>
|
||||
/// <remarks>This is a copy of the other DataView ctor and needs to be kept in sync</remarks>
|
||||
internal DataView(DataTable table, System.Predicate<DataRow> predicate, System.Comparison<DataRow> comparison, DataViewRowState RowState) {
|
||||
GC.SuppressFinalize(this);
|
||||
Bid.Trace("<ds.DataView.DataView|API> %d#, table=%d, RowState=%d{ds.DataViewRowState}\n",
|
||||
ObjectID, (table != null) ? table.ObjectID : 0, (int)RowState);
|
||||
if (table == null)
|
||||
throw ExceptionBuilder.CanNotUse();
|
||||
|
||||
this._dvListener = new DataViewListener(this);
|
||||
this._locked = false;
|
||||
this._table = table;
|
||||
_dvListener.RegisterMetaDataEvents(this._table);
|
||||
|
||||
if ((((int)RowState) &
|
||||
((int)~(DataViewRowState.CurrentRows | DataViewRowState.OriginalRows))) != 0) {
|
||||
throw ExceptionBuilder.RecordStateRange();
|
||||
}
|
||||
else if (( ((int)RowState) & ((int)DataViewRowState.ModifiedOriginal) ) != 0 &&
|
||||
( ((int)RowState) & ((int)DataViewRowState.ModifiedCurrent) ) != 0
|
||||
) {
|
||||
throw ExceptionBuilder.SetRowStateFilter();
|
||||
}
|
||||
_comparison = comparison;
|
||||
SetIndex2("", RowState, ((null != predicate) ? new RowPredicateFilter(predicate) : null), true);
|
||||
}
|
||||
|
||||
/// <summary>This method exists for LinqDataView to keep a level of abstraction away from the RBTree</summary>
|
||||
internal Range FindRecords<TKey, TRow>(Index.ComparisonBySelector<TKey, TRow> comparison, TKey key) where TRow : DataRow
|
||||
{
|
||||
return _index.FindRecords(comparison, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user