Esempio n. 1
0
        private void updateSuggestListBox(IntellisenseSuggest suggest, TextInputState source)
        {
            var values = suggest.Values.ToList();

            for (int i = 0; i < values.Count; i++)
            {
                values[i] = values[i].Replace(Environment.NewLine, " ");
            }

            lock (_syncSuggest)
            {
                _suggestSource = source;
                _suggestTypes  = suggest.Types;
                _suggestToken  = suggest.Token;

                _searchBar.SetMenuValues(values);
            }

            if (values.Count == 0)
            {
                continueEditingAfterSuggest();
            }
            else
            {
                updateSuggestLocation();
            }
        }
Esempio n. 2
0
        private void updateSuggestListBox(IntellisenseSuggest suggest, TextInputState source)
        {
            lock (_syncSuggest)
            {
                _suggestSource = source;
                _suggestTypes  = suggest.Types;
                _suggestToken  = suggest.Token;

                _listBoxSuggest.BeginUpdate();

                var index = _listBoxSuggest.SelectedIndex;

                _listBoxSuggest.Items.Clear();

                foreach (string value in suggest.Values)
                {
                    _listBoxSuggest.Items.Add(value);
                }

                _listBoxSuggest.SelectedIndex = index.WithinRange(-1, suggest.Values.Count - 1);

                _listBoxSuggest.EndUpdate();
            }

            if (suggest.Values.Count == 0)
            {
                _listBoxSuggest.Height = 0;
                continueEditingAfterSuggest();
            }
            else
            {
                _listBoxSuggest.Height = 2 + suggest.Values.Sum(getHeight);
                updateSuggestLocation();
            }
        }
Esempio n. 3
0
        private bool suggested(IntellisenseSuggest suggest, TextInputState source)
        {
            if (!_parent.Visible)
            {
                return(false);
            }

            return(_parent.Invoke(delegate { updateSuggestListBox(suggest, source); }));
        }
Esempio n. 4
0
        private void suggested(IntellisenseSuggest suggest, TextInputState source)
        {
            if (!_parent.Visible)
            {
                return;
            }

            _parent.Invoke(delegate { updateSuggestListBox(suggest, source); });
        }
Esempio n. 5
0
        private void updateSuggestListBox(IntellisenseSuggest suggest, TextInputState source)
        {
            var values = suggest.Values.ToList();

            for (int i = 0; i < values.Count; i++)
            {
                values[i] = values[i].Replace(Environment.NewLine, " ");
            }

            lock (_syncSuggest)
            {
                _suggestSource = source;
                _suggestTypes  = suggest.Types;
                _suggestToken  = suggest.Token;

                _listBoxSuggest.BeginUpdate();

                var index = _listBoxSuggest.SelectedIndex;

                _listBoxSuggest.Items.Clear();

                foreach (string value in values)
                {
                    _listBoxSuggest.Items.Add(value);
                }

                _listBoxSuggest.SelectedIndex = index.WithinRange(-1, values.Count - 1);

                _listBoxSuggest.EndUpdate();
            }

            if (values.Count == 0)
            {
                _listBoxSuggest.Height = 0;
                continueEditingAfterSuggest();
            }
            else
            {
                int contentHeight = values.Sum(getHeight);
                _listBoxSuggest.Height = 2 + contentHeight;
                updateSuggestLocation();
            }
        }