private void DgBuildListOnCellMouseUp( object sender,
DataGridViewCellMouseEventArgs dataGridViewCellMouseEventArgs)
{
bool segmented = chkSegmentedSource.Checked;
int ridx = dataGridViewCellMouseEventArgs.RowIndex;
int cidx = dataGridViewCellMouseEventArgs.ColumnIndex;
if (cidx == 0)
{
foreach (DataGridViewRow dataGridViewRow in dgBuildList.Rows)
{
dataGridViewRow.Cells[0].Value = null;
dataGridViewRow.DefaultCellStyle.BackColor = segmented ? Color.White : Color.WhiteSmoke;
dataGridViewRow.DefaultCellStyle.ForeColor = segmented ? Color.Black : Color.DarkGray;
dgBuildList.InvalidateRow( dataGridViewRow.Index );
_sourceFiles[dataGridViewRow.Index].Primary = false;
}
TranslationSourceInfo ti = _sourceFiles[ridx];
ti.Primary = true;
_sourceFiles.Remove( ti );
_sourceFiles.Insert( 0, ti );
_bindingSource.ResetBindings( false );
ColorBuildGrid();
foreach (DataGridViewRow dataGridViewRow in dgBuildList.Rows)
dataGridViewRow.Selected = dataGridViewRow.Index == 0;
SetButtonStates();
}
}