Esempio n. 1
0
 /// <summary>
 /// add new recording to treeview / code coverage
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAddRecording_Click(object sender, EventArgs e)
 {
     using (AddRecordingForm addRecForm = new AddRecordingForm())
     {
         addRecForm.ShowDialog();
         Recording recording = addRecForm.NewRecording;
         if (recording != null)
         {
             // if we already got a recording with the given name we have to remove it first
             for (int i = 0; i < codeCoverage_.Recordings.Count; ++i)
             {
                 if (codeCoverage_.Recordings[i].Name == recording.Name)
                 {
                     codeCoverage_.Recordings.RemoveAt(i);
                     break;
                 }
             }
             ListViewItem item = new ListViewItem(recording.Name);
             item.ImageIndex = (int)recording.RecordingType;
             lsvRecordings.Items.Add(item);
             codeCoverage_.Recordings.Add(recording);
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// add new recording to treeview / code coverage
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnAddRecording_Click(object sender, EventArgs e)
 {
     using(AddRecordingForm addRecForm = new AddRecordingForm())
     {
         addRecForm.ShowDialog();
         Recording recording = addRecForm.NewRecording;
         if (recording != null)
         {
             // if we already got a recording with the given name we have to remove it first
             for (int i = 0; i < codeCoverage_.Recordings.Count; ++i)
             {
                 if (codeCoverage_.Recordings[i].Name == recording.Name)
                 {
                     codeCoverage_.Recordings.RemoveAt(i);
                     break;
                 }
             }
             ListViewItem item = new ListViewItem(recording.Name);
             item.ImageIndex = (int)recording.RecordingType;
             lsvRecordings.Items.Add(item);
             codeCoverage_.Recordings.Add(recording);
         }
     }
 }