示例#1
0
 public BackgroundQuery(RowSourceWrapper rowSource, TaskScheduler backgroundTaskScheduler, IQueryRequest queryRequest)
 {
     RowSource = rowSource;
     BackgroundTaskScheduler = backgroundTaskScheduler;
     QueryRequest            = queryRequest;
     _rootCancellationToken  = QueryRequest.CancellationToken;
 }
示例#2
0
 public Request(QueryRequestor queryRequestor, QueryLock queryLock, RowSourceWrapper rowSourceWrapper)
 {
     _queryRequestor  = queryRequestor;
     RowSourceWrapper = rowSourceWrapper;
     QueryParameters  = _queryRequestor.QueryParameters;
     // ReSharper disable PossiblyMistakenUseOfParamsMethod
     _cancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(queryLock.CancellationToken);
     // ReSharper restore PossiblyMistakenUseOfParamsMethod
     QueryLock = queryLock;
 }
示例#3
0
 public void Requery()
 {
     using (var lastRequest = _request)
     {
         _request = null;
         if (null == QueryParameters || null == QueryParameters.ViewInfo)
         {
             return;
         }
         RowSourceWrapper rowSourceWrapper;
         if (lastRequest != null && ReferenceEquals(lastRequest.RowSourceWrapper.WrappedRowSource,
                                                    _bindingListView.RowSource))
         {
             rowSourceWrapper = lastRequest.RowSourceWrapper;
         }
         else
         {
             rowSourceWrapper = new RowSourceWrapper(_bindingListView.RowSource);
         }
         _request = new Request(this, _bindingListView.QueryLock, rowSourceWrapper);
         _request.StartQuery();
     }
 }
示例#4
0
 public ForegroundQuery(RowSourceWrapper rowSource, IQueryRequest queryRequest)
 {
     RowSource    = rowSource;
     QueryRequest = queryRequest;
 }
示例#5
0
 public BackgroundQuery(RowSourceWrapper rowSource, IQueryRequest queryRequest)
 {
     RowSource              = rowSource;
     QueryRequest           = queryRequest;
     _rootCancellationToken = QueryRequest.CancellationToken;
 }