Inheritance: System.EventArgs
 public override void OnSelected(SelectedEventArgs e)
 {
     var tb = Parent.TargetControlWrapper;
     //
     if (!Text.Contains("^"))
         return;
     var 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;
         }
 }
        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);
        }
 public void OnSelected(SelectedEventArgs args)
 {
     if (Selected != null)
         Selected(this, args);
 }
 /// <summary>
 /// This method is called after item was inserted into text
 /// </summary>
 public virtual void OnSelected(SelectedEventArgs e)
 {
 }
Beispiel #5
0
 /// <summary>
 /// This method is called after item was inserted into text
 /// </summary>
 public virtual void OnSelected(SelectedEventArgs e)
 {
 }