Ejemplo n.º 1
0
        private void mediaConfigFilesGridView_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            int rowIndex = e.RowIndex,
                columnIndex = e.ColumnIndex;

            if (rowIndex >= 0 && columnIndex >= 0)
            {
                var row = mediaConfigFilesGridView.Rows[rowIndex];
                MediaConfigFile mediaConfigFile = row.Tag as MediaConfigFile;

                using (var f = new EditMediaConfigFileForm(mediaConfigFile.Id))
                {
                    f.Saved += (s, eventArgs) =>
                    {
                        MediaConfigFilesGridViewRow(row, f.MediaConfigFile);
                        f.Close();
                    };

                    f.ShowDialog();
                }
            }
        }
Ejemplo n.º 2
0
        private void addMediaConfigFileButton_Click(object sender, EventArgs e)
        {
            using (var f = new EditMediaConfigFileForm())
            {
                DataGridViewRow row = null;

                f.Saved += (s, eventArgs) =>
                {
                    if (row == null)
                    {
                        row = mediaConfigFilesGridView.Rows[mediaConfigFilesGridView.Rows.Add()];
                    }
                    MediaConfigFilesGridViewRow(row, f.MediaConfigFile);
                    f.Close();
                };

                f.ShowDialog();
            }
        }