コード例 #1
0
ファイル: Form1.cs プロジェクト: sorgloomer/ActivityHistory
 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);
 }
コード例 #2
0
 public static string DateFromTimestamp(FocusChange focusChange)
 {
     return(focusChange.Timestamp.Substring(0, 10));
 }
コード例 #3
0
 public void WriteRow(FocusChange focusChange)
 {
     CsvWriter.WriteRecord(focusChange);
     CsvWriter.NextRecord();
 }
コード例 #4
0
 private void WriteRow(string fileName, FocusChange focusChange)
 {
     EnsureOpenedLogFile(fileName).WriteRow(focusChange);
 }
コード例 #5
0
 private string DetermineFileName(FocusChange focusChange)
 {
     return(string.Format(FileNamePattern, FocusChange.DateFromTimestamp(focusChange)));
 }
コード例 #6
0
 public void WriteRow(FocusChange focusChange)
 {
     WriteRow(DetermineFileName(focusChange), focusChange);
 }