Пример #1
0
 private Index(DataTable table, int[] ndexDesc, IndexField[] indexFields, Comparison<DataRow> comparison, DataViewRowState recordStates, IFilter rowFilter)
 {
     this._objectID = Interlocked.Increment(ref _objectTypeCount);
     Bid.Trace("<ds.Index.Index|API> %d#, table=%d, recordStates=%d{ds.DataViewRowState}\n", this.ObjectID, (table != null) ? table.ObjectID : 0, (int) recordStates);
     if ((recordStates & ~(DataViewRowState.OriginalRows | DataViewRowState.ModifiedCurrent | DataViewRowState.Added)) != DataViewRowState.None)
     {
         throw ExceptionBuilder.RecordStateRange();
     }
     this.table = table;
     this._listeners = new Listeners<DataViewListener>(this.ObjectID, listener => null != listener);
     this.IndexDesc = ndexDesc;
     this.IndexFields = indexFields;
     if (ndexDesc == null)
     {
         this.IndexDesc = Select.ConvertIndexFieldtoIndexDesc(indexFields);
     }
     this.recordStates = recordStates;
     this._comparison = comparison;
     DataColumnCollection columns = table.Columns;
     this.isSharable = (rowFilter == null) && (comparison == null);
     if (rowFilter != null)
     {
         this.rowFilter = new WeakReference(rowFilter);
         DataExpression expression = rowFilter as DataExpression;
         if (expression != null)
         {
             this._hasRemoteAggregate = expression.HasRemoteAggregate();
         }
     }
     this.InitRecords(rowFilter);
 }