Esempio n. 1
0
 public override void OnSelected(SelectedEventArgs e)
 {
     ITextBoxWrapper tb = Parent.TargetControlWrapper;
     //
     if (!Text.Contains("^"))
         return;
     string text = tb.Text;
     for (int i = Parent.Fragment.Start; i < text.Length; i++)
         if (text[i] == '^')
         {
             tb.SelectionStart = i;
             tb.SelectionLength = 1;
             tb.SelectedText = "";
             return;
         }
 }
Esempio n. 2
0
 public void OnSelected(SelectedEventArgs args)
 {
     if (Selected != null)
         Selected(this, args);
 }
Esempio n. 3
0
        internal virtual void OnSelecting()
        {
            if (SelectedItemIndex < 0 || SelectedItemIndex >= VisibleItems.Count)
                return;

            AutocompleteItem item = VisibleItems[SelectedItemIndex];
            var args = new SelectingEventArgs
                           {
                               Item = item,
                               SelectedIndex = SelectedItemIndex
                           };

            OnSelecting(args);

            if (args.Cancel)
            {
                SelectedItemIndex = args.SelectedIndex;
                (Host.ListView as Control).Invalidate(true);
                return;
            }

            if (!args.Handled)
            {
                Range fragment = Fragment;
                ApplyAutocomplete(item, fragment);
            }

            Close();
            //
            var args2 = new SelectedEventArgs
                            {
                                Item = item,
                                Control = TargetControlWrapper.TargetControl
                            };
            item.OnSelected(args2);
            OnSelected(args2);
        }
Esempio n. 4
0
 /// <summary>
 /// This method is called after item was inserted into text
 /// </summary>
 public virtual void OnSelected(SelectedEventArgs e)
 {
 }