protected virtual void OnCommandGenerated(CommandGeneratedEventArgs e) { EventHandler <CommandGeneratedEventArgs> handler = CommandGenerated; if (handler != null) { handler(this, e); } }
private void buttonCommandEdit_Click(object sender, EventArgs e) { string newCommand = CommandFetch(null, true); if (newCommand != null) { CommandGeneratedEventArgs args = new CommandGeneratedEventArgs(); args.test = false; args.command = newCommand; OnCommandGenerated(args); } }
private void macroToolStripMenuItem_Click(object sender, EventArgs e) { MacroEditor macroEditor = new MacroEditor("", IRServer, _BlastFunc, _LearnIrFunc, _ProcessCommand); macroEditor.ShowDialog(this); RefreshMacroList(macroEditor.MacroName); if (macroEditor.DialogResult == DialogResult.OK) { CommandGeneratedEventArgs args = new CommandGeneratedEventArgs(); args.test = false; args.command = Common.CmdPrefixMacro + macroEditor.MacroName; OnCommandGenerated(args); } }
private void commandList_CommandGenerated(object sender, CommandGeneratedEventArgs e) { if (e.test) { // Test the command // TODO } else { // Insert command in the list EditedMacro = true; if (listBoxMacro.SelectedIndex > -1) { InsertCommand(e.command, listBoxMacro.SelectedIndex + 1); listBoxMacro.SelectedIndex = listBoxMacro.SelectedIndex + 1; } else { InsertCommand(e.command); listBoxMacro.SelectedIndex = listBoxMacro.Items.Count - 1; } } }
protected virtual void OnCommandGenerated(CommandGeneratedEventArgs e) { EventHandler<CommandGeneratedEventArgs> handler = CommandGenerated; if (handler != null) { handler(this, e); } }
private void commandManager_CommandGenerated(object sender, CommandGeneratedEventArgs e) { if (e.test) { // Test the command // TODO } else { // Insert command in the list InsertCommand(e.command); } }