// Displays the FindReplaceDialog with the specified tab active, and sets the selection/text appropriately. private void ShowFindReplaceTab(string tabName) { HideIncrementalSearch(); if (!Window.Visible) { Window.Show(Editor.FindForm()); } Window.tabAll.SelectedTab = Window.tabAll.TabPages[tabName]; if (Editor.LineFromPosition(Editor.Selections[0].Start) != Editor.LineFromPosition(Editor.Selections[0].End)) { Window.chkSearchSelection.Checked = true; } if (CurrentQuery != null) { Window.txtFind.Text = CurrentQuery.ToString(); } else if (Editor.Selections[0].End > Editor.Selections[0].Start) { Window.txtFind.Text = Editor.SelectedText; } Window.txtFind.Select(); Window.txtFind.SelectAll(); }
protected void UpdateCurrentSearchQueryAndPage(string query) { if (!CurrentQuery.Equals(query)) { CurrentPage = 1; CurrentQuery = query; } }
private async Task createTag() { var createdTag = await dataSource.Tags .Create(CurrentQuery.Trim(), TextFieldInfo.WorkspaceId.Value); var tagSuggestion = new TagSuggestion(createdTag); await SelectSuggestionCommand.ExecuteAsync(tagSuggestion); }
public SimpleStatement BuildQuery() { string queryText = CurrentQuery.WriteQuery().ToString(); if (Parameters.Count == 0) { return(new SimpleStatement(queryText)); } return(new SimpleStatement(Parameters, queryText)); }
protected override void TryChangeQueryValueCount() { if (State.Last == null || State.Last.TotalUsed < NewState.Last.TotalUsed) { CurrentQuery.AugmentQueryValueCount(NewState.Last.TotalUsed - State.Last.TotalUsed); } else if (State.Last == null || State.Last.TotalUsed > NewState.Last.TotalUsed) { CurrentQuery.AbridgeQueryValueCount(State.Last.TotalUsed - NewState.Last.TotalUsed); } }
protected override void TryChangeQueryLevelCount() { if (State.LevelCount < NewState.LevelCount) { CurrentQuery.AugmentQueryLevelCount(NewState.LevelCount - State.LevelCount); } else if (State.LevelCount > NewState.LevelCount) { CurrentQuery.AbridgeQueryLevelCount(State.LevelCount - NewState.LevelCount); } }
protected override object GetItemAt(NSIndexPath indexPath) { if (!SuggestCreation) { return(base.GetItemAt(indexPath)); } if (indexPath.Item == 0) { return($"{Resources.CreateTag} \"{CurrentQuery.Trim()}\""); } return(ItemsSource.ElementAt((int)indexPath.Item - 1)); }
/// <summary> /// Shows the <see cref="IncrementalSearcher"/> control. /// </summary> public void ShowIncrementalSearch() { HideFindReplace(); SetIncrementalSearchPosition(); if (CurrentQuery != null) { SearchBar.txtFind.Text = CurrentQuery.ToString(); } else if (Editor.Selections[0].End > Editor.Selections[0].Start) { SearchBar.txtFind.Text = Editor.SelectedText; } SearchBar.Show(); SearchBar.txtFind.Focus(); SearchBar.txtFind.SelectAll(); }
protected override IEnumerator ForcedSolveIEnumerator() { yield return(null); while (State != TwoBitsState.Complete) { if (CurrentQuery.StartsWith("_") && State == TwoBitsState.Idle) { yield return(DoInteractionClick(_buttons[ButtonLabels.IndexOf(CorrectResponse.Substring(0, 1), StringComparison.Ordinal)])); } if (CurrentQuery.EndsWith("_") && State == TwoBitsState.Idle) { yield return(DoInteractionClick(_buttons[ButtonLabels.IndexOf(CorrectResponse.Substring(1, 1), StringComparison.Ordinal)])); } if (State == TwoBitsState.Idle) { yield return(CorrectResponse.Equals(CurrentQuery) ? DoInteractionClick(_submit) : DoInteractionClick(_query)); } yield return(true); } }
private void OnCancel() { CurrentQuery.RejectChanges(); ActiveModel.QueryTagMappings.RejectChanges(); }
private void OnSave() { CurrentQuery.AcceptChanges(); ActiveModel.QueryTagMappings.AcceptChanges(); }
private async Task createProject() { var projectId = await navigationService.Navigate <EditProjectViewModel, string, long?>(CurrentQuery.Trim()); if (projectId == null) { return; } var project = await dataSource.Projects.GetById(projectId.Value); var projectSuggestion = new ProjectSuggestion(project); await SelectSuggestionCommand.ExecuteAsync(projectSuggestion); }