Inheritance: System.EventArgs
 internal void OnSelecting(SelectingEventArgs args)
 {
     if (Selecting != null)
     {
         Selecting(this, args);
     }
 }
        internal virtual void OnSelecting()
        {
            if (selectedItemIndex < 0 || selectedItemIndex >= visibleItems.Count)
            {
                return;
            }
            tb.TextSource.Manager.BeginAutoUndoCommands();
            try
            {
                AutocompleteItem   item = visibleItems[selectedItemIndex];
                SelectingEventArgs args = new SelectingEventArgs()
                {
                    Item          = item,
                    SelectedIndex = selectedItemIndex
                };

                Menu.OnSelecting(args);

                if (args.Cancel)
                {
                    selectedItemIndex = args.SelectedIndex;
                    DoSelectedVisible();
                    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.TextSource.Manager.EndAutoUndoCommands();
            }
        }
Ejemplo n.º 3
0
        internal virtual void OnSelecting()
        {
            if (this.FocussedItemIndex < 0 || this.FocussedItemIndex >= visibleItems.Count)
            {
                return;
            }
            tb.TextSource.Manager.BeginAutoUndoCommands();
            try
            {
                AutocompleteItem   item = this.FocussedItem;
                SelectingEventArgs args = new SelectingEventArgs()
                {
                    Item          = item,
                    SelectedIndex = FocussedItemIndex
                };

                this.Menu.OnSelecting(args);

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

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

                this.Menu.Close();
                //
                SelectedEventArgs args2 = new SelectedEventArgs()
                {
                    Item = item,
                    Tb   = this.Menu.Fragment.tb
                };
                item.OnSelected(this.Menu, args2);
                this.Menu.OnSelected(args2);
            }
            finally
            {
                tb.TextSource.Manager.EndAutoUndoCommands();
            }
        }
        internal virtual void OnSelecting()
        {
            if (FocussedItemIndex < 0 || FocussedItemIndex >= VisibleItems.Count)
            {
                return;
            }
            _tb.TextSource.Manager.BeginAutoUndoCommands();
            try
            {
                var item = FocussedItem;
                var args = new SelectingEventArgs
                {
                    Item          = item,
                    SelectedIndex = FocussedItemIndex
                };

                Menu.OnSelecting(args);

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

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

                Menu.Close();
                //
                var args2 = new SelectedEventArgs
                {
                    Item = item,
                    Tb   = Menu.Fragment.Tb
                };
                item.OnSelected(Menu, args2);
                Menu.OnSelected(args2);
            }
            finally
            {
                _tb.TextSource.Manager.EndAutoUndoCommands();
            }
        }
Ejemplo n.º 5
0
 internal void OnSelecting(SelectingEventArgs args)
 {
     if (Selecting != null)
         Selecting(this, args);
 }
Ejemplo n.º 6
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();
            }
        }
 internal void OnSelecting(SelectingEventArgs args)
 {
     Selecting?.Invoke(this, args);
 }
Ejemplo n.º 8
0
 internal void OnSelecting(SelectingEventArgs args)
 {
     Selecting?.Invoke(this, args);
 }
        internal virtual void OnSelecting()
        {
            if (FocussedItemIndex < 0 || FocussedItemIndex >= VisibleItems.Count)
                return;
            _tb.TextSource.Manager.BeginAutoUndoCommands();
            try
            {
                var item = FocussedItem;
                var args = new SelectingEventArgs
                {
                    Item = item,
                    SelectedIndex = FocussedItemIndex
                };

                Menu.OnSelecting(args);

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

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

                Menu.Close();
                //
                var args2 = new SelectedEventArgs
                {
                    Item = item,
                    Tb = Menu.Fragment.Tb
                };
                item.OnSelected(Menu, args2);
                Menu.OnSelected(args2);
            }
            finally
            {
                _tb.TextSource.Manager.EndAutoUndoCommands();
            }
        }