Ejemplo n.º 1
0
 /// <summary>
 /// This method is called after item inserted into text
 /// </summary>
 public virtual void OnSelected(AutoCompleteMenu popupMenu, SelectedEventArgs e)
 {
     ;
 }
Ejemplo n.º 2
0
 public void OnSelected(SelectedEventArgs args)
 {
     if (Selected != null)
         Selected(this, args);
 }
Ejemplo n.º 3
0
        internal virtual void OnSelecting()
        {
            if (selectedItemIndex < 0 || selectedItemIndex >= visibleItems.Count)
                return;
            tb.manager.BeginAutoUndoCommands();
            try
            {
                AutoCompleteItem item = visibleItems[selectedItemIndex];
                SelectingEventArgs args = new SelectingEventArgs()
                {
                    Item = item,
                    SelectedIndex = selectedItemIndex
                };

                Menu.OnSelecting(args);

                if (args.Cancel)
                {
                    selectedItemIndex = args.SelectedIndex;
                    Invalidate();
                    return;
                }

                if (!args.Handled)
                {
                    var fragment = Menu.Fragment;
                    DoAutocomplete(item, fragment);
                }

                Menu.Close();
                //
                SelectedEventArgs args2 = new SelectedEventArgs()
                {
                    Item = item,
                    Tb = Menu.Fragment.tb
                };
                item.OnSelected(Menu, args2);
                Menu.OnSelected(args2);
            }
            finally
            {
                tb.manager.EndAutoUndoCommands();
            }
        }