Beispiel #1
0
        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));
        }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 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;
 }
Beispiel #4
0
        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());
        }
Beispiel #5
0
        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;
            }
        }
Beispiel #6
0
 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());
 }
Beispiel #7
0
 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;
 }
Beispiel #8
0
 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;
 }
Beispiel #9
0
 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;
 }