private void profileGrid_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0 || e.ColumnIndex == 1) { var currentProfiles = _profileManager.Fetch(); var scProfile = currentProfiles.SolrProfiles[e.RowIndex]; //Edit if (e.ColumnIndex == 0) { SolrCreateProfile profile = new SolrCreateProfile(_profileManager); profile.SetProfile(scProfile); profile.ShowDialog(); RefreshList(); } //Delete if (e.ColumnIndex == 1) { if (MessageBox.Show($"Are you sure you wish to remove the profile '{scProfile.Name}'?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { currentProfiles.SolrProfiles.Remove(scProfile); _profileManager.Update(currentProfiles); RefreshList(); } } } }
private void button1_Click(object sender, EventArgs e) { SolrCreateProfile profile = new SolrCreateProfile(_profileManager); profile.ShowDialog(); RefreshList(); }
private void profileGrid_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0 || e.ColumnIndex == 1) { var currentProfiles = _profileManager.Fetch(); var scProfile = currentProfiles.SolrProfiles[e.RowIndex]; //Edit if (e.ColumnIndex == 0) { SolrCreateProfile profile = new SolrCreateProfile(_profileManager); profile.SetProfile(scProfile); profile.ShowDialog(); RefreshList(); } } }