Beispiel #1
0
 public QueryRequestor(BindingListView bindingListView)
 {
     _bindingListView = bindingListView;
     // ReSharper disable once PossiblyMistakenUseOfParamsMethod
     _cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(bindingListView.CancellationToken);
     _queryParameters = QueryParameters.Empty;
     _rowSourceWrapper = RowSourceWrapper.Empty;
 }
Beispiel #2
0
 public void SetRowsAndParameters(IEnumerable rowSource, QueryParameters queryParameters)
 {
     if (ReferenceEquals(RowSource, rowSource) && Equals(QueryParameters, queryParameters))
     {
         return;
     }
     _rowSourceWrapper = WrapRowSource(rowSource);
     _queryParameters = queryParameters;
     Requery();
 }
Beispiel #3
0
 public QueryResults SetParameters(QueryParameters newParameters)
 {
     var result = new QueryResults
                      {
                          Parameters = newParameters
                      };
     if (Parameters.PivotValid(result.Parameters))
     {
         result.PivotedRows = PivotedRows;
         result.ItemProperties = ItemProperties;
         if (Parameters.FilterValid(newParameters))
         {
             result.FilteredRows = FilteredRows;
             if (Parameters.SortValid(newParameters))
             {
                 result.SortedRows = SortedRows;
             }
             else
             {
                 result.SortedRows = null;
             }
         }
         else
         {
             result.FilteredRows = result.SortedRows = null;
         }
     }
     else
     {
         if (result.Parameters.ViewInfo == null)
         {
             result.SortedRows = result.FilteredRows = result.PivotedRows = Empty.ResultRows;
         }
         else
         {
             result.SortedRows = result.FilteredRows = result.PivotedRows = null;
         }
         result.ItemProperties = null;
     }
     return result;
 }
Beispiel #4
0
 public void Dispose()
 {
     _cancellationTokenSource.Cancel();
     _queryParameters = null;
     _rowSourceWrapper = null;
     _request = null;
 }
 public bool PivotValid(QueryParameters that)
 {
     return ReferenceEquals(ViewInfo, that.ViewInfo);
 }
 public bool FilterValid(QueryParameters that)
 {
     return PivotValid(that) && Equals(RowFilter, that.RowFilter);
 }
 public QueryParameters(QueryParameters that)
 {
     ViewInfo = that.ViewInfo;
     RowFilter = that.RowFilter;
     SortDescriptions = that.SortDescriptions;
 }
 public bool SortValid(QueryParameters that)
 {
     return FilterValid(that) && Equals(SortDescriptions, that.SortDescriptions);
 }