Inheritance: System.EventArgs
Esempio n. 1
0
        // The user selected something in the popup menu. Fire event indicating the change.
        void popup_Selected(object sender, SymbolPopupEventArgs eventArgs)
        {
            Debug.Assert(popupKind != ChangeKind.None);

            if (Change != null)
            {
                object newValue = null;
                if (eventArgs.TextSelected != null)
                {
                    newValue = eventArgs.TextSelected;
                }
                else if (eventArgs.SymbolSelected != null)
                {
                    newValue = eventArgs.SymbolSelected;
                }

                Change(this, popupKind, popupLine, popupBox, newValue);
            }
        }
Esempio n. 2
0
        // An item was clicked.
        void ItemClicked(object sender, ToolStripItemClickedEventArgs args)
        {
            SymbolPopupEventArgs selectedArgs = new SymbolPopupEventArgs();
            object clicked = args.ClickedItem;

            if (clicked is ToolStripButton)
            {
                string id = (clicked as ToolStripButton).Text;
                if (id != "none")
                {
                    selectedArgs.SymbolSelected = symbolDB[id];
                }
                if (Selected != null)
                {
                    Selected(this, selectedArgs);
                }
            }
            else if (clicked is ToolStripTextBox)
            {
                string text = (clicked as ToolStripTextBox).Text;
                if (text == "")
                {
                    text = null;
                }
                selectedArgs.TextSelected = text;
                if (Selected != null)
                {
                    Selected(this, selectedArgs);
                }
            }
            else
            {
                // Any other control (e.g., the info label) just cancels.
                if (Canceled != null)
                {
                    Canceled(this, EventArgs.Empty);
                }
            }
        }
Esempio n. 3
0
        // An item was clicked.
        void ItemClicked(object sender, ToolStripItemClickedEventArgs args)
        {
            SymbolPopupEventArgs selectedArgs = new SymbolPopupEventArgs();
            object clicked = args.ClickedItem;

            if (clicked is ToolStripButton) {
                string id = (clicked as ToolStripButton).Text;
                if (id != "none")
                    selectedArgs.SymbolSelected = symbolDB[id];
                if (Selected != null)
                    Selected(this, selectedArgs);
            }
            else if (clicked is ToolStripTextBox) {
                string text = (clicked as ToolStripTextBox).Text;
                if (text == "")
                    text = null;
                selectedArgs.TextSelected = text;
                if (Selected != null)
                    Selected(this, selectedArgs);
            }
            else {
                // Any other control (e.g., the info label) just cancels.
                if (Canceled != null)
                    Canceled(this, EventArgs.Empty);
            }
        }
Esempio n. 4
0
        // The user selected something in the popup menu. Fire event indicating the change.
        void popup_Selected(object sender, SymbolPopupEventArgs eventArgs)
        {
            Debug.Assert(popupKind != ChangeKind.None);

            if (Change != null) {
                object newValue = null;
                if (eventArgs.TextSelected != null)
                    newValue = eventArgs.TextSelected;
                else if (eventArgs.SymbolSelected != null)
                    newValue = eventArgs.SymbolSelected;

                Change(this, popupKind, popupLine, popupBox, newValue);
            }
        }