private void RegisterFocusChange(FocusChange focusChange) { FocusChanges.Add(focusChange); new DataGridViewRow(); dataGridView1.Rows.Insert( 0, focusChange.Timestamp, focusChange.FocusInfo.WindowTitle, focusChange.FocusInfo.ExecutableName ); while (dataGridView1.Rows.Count > MaxHistoryRowCount) { dataGridView1.Rows.RemoveAt(dataGridView1.Rows.Count - 1); } rowWriter.WriteRow(focusChange); }
public static string DateFromTimestamp(FocusChange focusChange) { return(focusChange.Timestamp.Substring(0, 10)); }
public void WriteRow(FocusChange focusChange) { CsvWriter.WriteRecord(focusChange); CsvWriter.NextRecord(); }
private void WriteRow(string fileName, FocusChange focusChange) { EnsureOpenedLogFile(fileName).WriteRow(focusChange); }
private string DetermineFileName(FocusChange focusChange) { return(string.Format(FileNamePattern, FocusChange.DateFromTimestamp(focusChange))); }
public void WriteRow(FocusChange focusChange) { WriteRow(DetermineFileName(focusChange), focusChange); }