private void OnCellContentClick(object sender, DataGridViewCellEventArgs e) { if (clearingTables) { return; } if (e.ColumnIndex != PARAMS_COLUMN_LOCK) { return; } DataGridView table = (DataGridView)sender; MaidInfo maid = SelectedMaid; if (maid == null) { return; } MaidChangeType?type = null; if (table == dataGridView_params) { type = maidParamsTableDic[e.RowIndex]; } else if (table == dataGridView_ero_zones) { type = maidEroTableDic[e.RowIndex]; } else if (table == dataGridView_statistics) { type = maidStatsTableDic[e.RowIndex]; } if (type == null) { return; } bool val = !((bool)table[e.ColumnIndex, e.RowIndex].Value); if (val) { maid.Lock(type.Value); } else { maid.Unlock(type.Value); } }