Esempio n. 1
0
        /// <summary>
        /// User wants to edit app info for an application. Display
        /// form to edit the info
        /// </summary>
        /// <param name="e">event args</param>
        private void handleEditAppInfo(DataGridViewCellEventArgs e)
        {
            var row = dataGridView2.Rows[e.RowIndex];

            Hide();

            var form = new EditAppInfoForm
            {
                AppName   = row.Cells[AppNameColumn.Name].Value as String,
                Path      = row.Cells[PathColumn.Name].Value as String,
                Arguments = row.Cells[ArgumentsColumn.Name].Value as String
            };

            var dialogResult = form.ShowDialog();

            Show();

            if (dialogResult == DialogResult.OK)
            {
                row.Cells[AppNameColumn.Name].Value   = form.AppName;
                row.Cells[PathColumn.Name].Value      = form.Path;
                row.Cells[ArgumentsColumn.Name].Value = form.Arguments;

                _isDirty = true;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Event handler to add a new app.  Displays a form for the
        /// user to enter app info
        /// </summary>
        /// <param name="sender">event sender</param>
        /// <param name="e">event args</param>
        private void buttonAddNew_Click(object sender, EventArgs e)
        {
            Hide();

            var form = new EditAppInfoForm();

            var dialogResult = form.ShowDialog();

            Show();

            if (dialogResult == DialogResult.OK)
            {
                _isDirty = true;

                Applications.Add(new AppInfo(form.AppName, form.Path, form.Arguments));

                refreshDataGridView();
            }
        }