Пример #1
0
        // 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();
        }
Пример #2
0
 protected void UpdateCurrentSearchQueryAndPage(string query)
 {
     if (!CurrentQuery.Equals(query))
     {
         CurrentPage  = 1;
         CurrentQuery = query;
     }
 }
Пример #3
0
        private async Task createTag()
        {
            var createdTag = await dataSource.Tags
                             .Create(CurrentQuery.Trim(), TextFieldInfo.WorkspaceId.Value);

            var tagSuggestion = new TagSuggestion(createdTag);
            await SelectSuggestionCommand.ExecuteAsync(tagSuggestion);
        }
Пример #4
0
        public SimpleStatement BuildQuery()
        {
            string queryText = CurrentQuery.WriteQuery().ToString();

            if (Parameters.Count == 0)
            {
                return(new SimpleStatement(queryText));
            }

            return(new SimpleStatement(Parameters, queryText));
        }
Пример #5
0
 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);
     }
 }
Пример #6
0
 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);
     }
 }
Пример #7
0
        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));
        }
Пример #8
0
 /// <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);
        }
    }
Пример #10
0
 private void OnCancel()
 {
     CurrentQuery.RejectChanges();
     ActiveModel.QueryTagMappings.RejectChanges();
 }
Пример #11
0
 private void OnSave()
 {
     CurrentQuery.AcceptChanges();
     ActiveModel.QueryTagMappings.AcceptChanges();
 }
Пример #12
0
        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);
        }