public override void SetContent(PopupWindowContent content)
        {
            lstEntries.DataSource    = content.AutoSuggestEntries.OrderBy(x => x.AutoSuggestString).ToList();
            lstEntries.DisplayMember = "AutoSuggestString";
            //lstEntries.Items.Clear();
            //lstEntries.Items.AddRange(content.AutoSuggestEntries.Select(e => e.AutoSuggestString).ToArray<object>());
            if (lstEntries.Items.Count > 0)
            {
                lstEntries.SelectedIndex = 0;
            }

            Focus();
        }
        private void testButton_Click(object sender, EventArgs e)
        {
            var sourceText = sourceTextBox.Text;

            if (string.IsNullOrEmpty(sourceText))
            {
                return;
            }

            var autoSuggestEntries = _regexPatternEntries.GetAutoSuggestEntries(sourceText, _variables);
            var popupContent       = new PopupWindowContent(autoSuggestEntries);

            evaluationPopupWindow.SetContent(popupContent);
        }
 public override void SetContent(PopupWindowContent content)
 {
     suggestionsListBox.Items.Clear();
     suggestionsListBox.Items.AddRange(content.AutoSuggestEntries
                                       .Select(e => e.AutoSuggestString)
                                       .Distinct()
                                       .OrderBy(s => s)
                                       .ToArray <object>());
     if (suggestionsListBox.Items.Count > 0)
     {
         suggestionsListBox.SelectedIndex = 0;
     }
     Focus();
 }
Пример #4
0
 public virtual void SetContent(PopupWindowContent content)
 {
     throw new NotImplementedException("This method must be overridden");
 }
Пример #5
0
 public void Show(Point caretPosition, PopupWindowContent content)
 {
     ToolStripDropDown.Show(caretPosition);
     PopupWindow.SetContent(content);
 }