Example #1
0
 private void addViewItem(ConfigClass val)
 {
     keysListView.Items.Add(new ListViewItem(new[] { val.getName(), string.Join("+", val.getKeyPairs())
                                                     , val.getType().ToString()
                                                     , val.getType() == ConfigClass.CommandType.EXE ? val.getExeFile() + " " + val.getExeArg()
         :val.getType() == ConfigClass.CommandType.KEY ? val.getTargetKey().ToString() : val.getCmdLine() }, val.getKeyPairs().GetHashCode()));
 }
        public ConfigAddForm(ConfigClass _config) : this()
        {
            this.Text = "Edit Item";
            config    = _config;

            nameView.Text = config.getName();
            keysView.Text = string.Join("+", config.getKeyPairs());
            switch (config.getType())
            {
            case ConfigClass.CommandType.EXE:
            {
                typeView.SelectedIndex = 0;
                exeFileView.Text       = config.getExeFile();
                exeArgView.Text        = config.getExeArg();
                break;
            }

            case ConfigClass.CommandType.KEY:
            {
                typeView.SelectedIndex = 1;
                targetKeyView.Text     = config.getTargetKey().ToString();
                break;
            }

            case ConfigClass.CommandType.CMD:
            {
                typeView.SelectedIndex = 2;
                cmdLineView.Text       = config.getCmdLine();
                break;
            }

            default:
                break;
            }

            keysSaved = new KeyPair(_config.getKeyPairs());
        }