Ejemplo n.º 1
0
        private void cmdEdit_Click(object sender, System.EventArgs e)
        {
            if (this.lvProgs.SelectedItems.Count == 0)
            {
                return;
            }

            if (this.txtExecutable.Text.Trim() == "")
            {
                MessageBox.Show(this, "Please fill in a path to the executable to continue.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            else if (!File.Exists(this.txtExecutable.Text.Trim()))
            {
                MessageBox.Show(this, "File \"" + txtExecutable.Text + "\" not found.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            CConfig.DebugExecEntry entry = (CConfig.DebugExecEntry) this.lvProgs.SelectedItems[0].Tag;

            entry.path       = txtExecutable.Text;
            entry.parameters = txtParams.Text;

            this.txtExecutable.Text = "";
            this.txtParams.Text     = "";

            PopulateList();
        }
Ejemplo n.º 2
0
        private void lvProgs_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if ((sender as ListView).SelectedItems.Count == 0)
            {
                return;
            }

            this.cmdEdit.Enabled   = true;
            this.cmdDelete.Enabled = true;

            CConfig.DebugExecEntry entry = (CConfig.DebugExecEntry) this.lvProgs.SelectedItems[0].Tag;

            txtExecutable.Text = entry.path;
            txtParams.Text     = entry.parameters;
        }