示例#1
0
 void ResetDgvFilenames(IList <string> filenames)
 {
     DgvFilenames.Rows.Clear();
     foreach (var file in filenames)
     {
         var cell = new DataGridViewTextBoxCell();
         cell.Value = file;
         var row = new DataGridViewRow();
         row.Cells.Add(cell);
         DgvFilenames.Rows.Add(row);
     }
     DgvFilenames.ClearSelection();
 }
示例#2
0
        public void OnFileProcessing(string filename)
        {
            DgvFilenames.InvokeIfRequired(() =>
            {
                foreach (var row in DgvFilenames.Rows.Cast <DataGridViewRow>())
                {
                    if (filename != row.Cells[0].Value as string)
                    {
                        continue;
                    }

                    row.DefaultCellStyle.BackColor = Color.Gold;
                    DgvFilenames.Refresh();
                    return;
                }
            });
        }