Ejemplo n.º 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));
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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());
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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());
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }