Beispiel #1
0
        // This is method is internal to
        // the Mono implementation of DataView; it
        // is not to be used from your code.
        //
        // Update the DataRowView array which is an index cache
        // into the DataTable's DataRowCollection.
        //
        // I assume this is what UpdateIndex is used for
        protected virtual void UpdateIndex(bool force)
        {
            if (Table == null)
            {
                // FIXME
                return;
            }

            if (Index == null || force)
            {
                sortColumns = DataTable.ParseSortString(Table, Sort, out sortOrder, false);
                Index       = dataTable.GetIndex(sortColumns, sortOrder, RowStateFilter, FilterExpression, true);
            }
            else
            {
                Index.Key.RowStateFilter = RowStateFilter;
                Index.Reset();
            }

            int[] records = Index.GetAll();

            if (records != null)
            {
                InitDataRowViewArray(records, Index.Size);
            }
            else
            {
                rowCache = new DataRowView [0];
            }
        }