Example #1
0
        public void OnButtonClick(object sender, EventArgs e)
        {
            var control = sender as ToolStripButton;

            if (control != null)
            {
                var commandId = control.Tag as string;
                _eventAggregator.PublishEvent <CommandSelectedAggregatedEvent>(CommandSelectedAggregatedEvent.Create(commandId));
            }
        }
Example #2
0
        void OnMenuItemClick(object sender, EventArgs e)
        {
            ToolStripMenuItem item = sender as ToolStripMenuItem;

            if (item.IsNullObj())
            {
                return;
            }

            string commandId = item.Tag as string;

            if (commandId.IsNull())
            {
                return;
            }

            CommandSelectedAggregatedEvent aggregatedEvent = new CommandSelectedAggregatedEvent();

            aggregatedEvent.CommandId = commandId;

            _eventAggregator.PublishEvent(aggregatedEvent);
        }