private void SearchCompleted(Task <int> task) { switch (task.Status) { case TaskStatus.RanToCompletion: _searchCallback.ReportComplete(this, (uint)task.Result); break; case TaskStatus.Faulted: case TaskStatus.Canceled: _searchCallback.ReportComplete(this, 0); break; default: throw new ArgumentOutOfRangeException(); } }
protected override void OnStartSearch() { base.OnStartSearch(); bool found = false; var searchString = SearchQuery.SearchString; if (_grid?.Items != null && !string.IsNullOrWhiteSpace(searchString)) { found = Find(s => s.StartsWithOrdinal(searchString)); if (!found) { found = Find(s => s.Contains(searchString)); } } if (!found) { _callback.ReportComplete(this, 0); } }
protected override void OnStartSearch() { base.OnStartSearch(); _callback.ReportComplete(this, 1); var searchString = SearchQuery.SearchString; if (!string.IsNullOrWhiteSpace(searchString)) { SearchAsync(searchString).DoNotWait(); } }
protected override async void OnStartSearch() { base.OnStartSearch(); _callback.ReportComplete(this, 1); var searchString = SearchQuery.SearchString; if (!string.IsNullOrWhiteSpace(searchString)) { var session = _workflowProvider.GetOrCreate().RSession; using (var inter = await session.BeginInteractionAsync()) { await inter.RespondAsync("?" + searchString + Environment.NewLine); } } }
protected override async void OnStartSearch() { base.OnStartSearch(); _callback.ReportComplete(this, 1); var searchString = SearchQuery.SearchString; if (!string.IsNullOrWhiteSpace(searchString)) { try { var session = _workflowProvider.GetOrCreate().RSession; await session.ExecuteAsync($"rtvs:::show_help({searchString.ToRStringLiteral()})"); } catch (OperationCanceledException) { } catch (RException) { } catch (MessageTransportException) { } } }
public void Start() { Status = (uint)__VSSEARCHTASKSTATUS.STS_STARTED; StringCount = 0; StopRequested = false; if (Designer.Model.StateMachine != null) { SearchableObjects = GatherObjects(); foreach (ObjectModel.TrackableObject o in SearchableObjects) { StringCount += o.Search(SearchQuery.SearchString); if (StopRequested) { break; } } } SearchCallback.ReportComplete(this, StringCount); }