public override bool Equals(object obj) { QuickCommand other = obj as QuickCommand; if (other == null) { return(false); } return((this.commandName == other.commandName) && (this.parameters == other.parameters) && (this.id == other.id) && (this.module == other.module)); }
private void RemoveQuickCommand(QuickCommand quickCommand) { if ((quickCommand == null) || !quickCommands.Contains(quickCommand)) { btnQCDelete.Enabled = false; return; } quickCommands.Remove(quickCommand); if (lstQuickCommands.Items.Contains(quickCommand)) { lstQuickCommands.Items.Remove(quickCommand); } lstQuickCommands.SelectedIndex = -1; }
private void SelectQuickCommand(QuickCommand quickCommand) { if (this.InvokeRequired) { return; } if ((quickCommand == null) || !quickCommands.Contains(quickCommand)) { selectedQuickCommand = null; btnQCDelete.Enabled = false; return; } selectedQuickCommand = quickCommand; btnQCDelete.Enabled = true; }
private void SendQuickCommand(QuickCommand quickCommand) { if (!modules.ContainsKey(quickCommand.Module)) { return; } ConnectionManager cnnMan = modules[quickCommand.Module]; Command cmd = quickCommand.GetCommand(cnnMan); if (cmd == null) { return; } cnnMan.Send(cmd); Console("Sent: " + cmd.ToString()); }
private void AddQuickCommand(string moduleName, string commandName, string parameters, int id) { if (!modules.ContainsKey(moduleName)) { return; } if (id > 99) { id = 99; } QuickCommand qc = new QuickCommand(moduleName, commandName, parameters, id); if (quickCommands.Contains(qc)) { return; } quickCommands.Add(qc); lstQuickCommands.Items.Add(qc); if (lstQuickCommands.Items.Contains(qc)) { lstQuickCommands.SelectedItem = qc; } }
private void SendQuickCommand(QuickCommand quickCommand) { if (!modules.ContainsKey(quickCommand.Module)) return; ConnectionManager cnnMan = modules[quickCommand.Module]; Command cmd = quickCommand.GetCommand(cnnMan); if (cmd == null) return; cnnMan.Send(cmd); Console("Sent: " + cmd.ToString()); }
private void SelectQuickCommand(QuickCommand quickCommand) { if (this.InvokeRequired) return; if ((quickCommand == null) || !quickCommands.Contains(quickCommand)) { selectedQuickCommand = null; btnQCDelete.Enabled = false; return; } selectedQuickCommand = quickCommand; btnQCDelete.Enabled = true; }
private void RemoveQuickCommand(QuickCommand quickCommand) { if ((quickCommand == null) || !quickCommands.Contains(quickCommand)) { btnQCDelete.Enabled = false; return; } quickCommands.Remove(quickCommand); if (lstQuickCommands.Items.Contains(quickCommand)) lstQuickCommands.Items.Remove(quickCommand); lstQuickCommands.SelectedIndex = -1; }
private void AddQuickCommand(string moduleName, string commandName, string parameters, int id) { if (!modules.ContainsKey(moduleName)) return; if (id > 99) id = 99; QuickCommand qc = new QuickCommand(moduleName, commandName, parameters, id); if (quickCommands.Contains(qc)) return; quickCommands.Add(qc); lstQuickCommands.Items.Add(qc); if (lstQuickCommands.Items.Contains(qc)) lstQuickCommands.SelectedItem = qc; }