예제 #1
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     //if ((lstDataCaptureList.SelectedIndex > -1) && (lstDataCaptureList.SelectedIndex < dcaplist.DataCaptureConfigurationList.Count))
     if (dgvDataCap.SelectedRows.Count > 0)
     {
         DataCapture dc    = new DataCapture();
         int         index = Convert.ToInt32(dgvDataCap.SelectedRows[0].Cells[0].Value.ToString());
         if (index < tempdclist.DataCaptureConfigurationList.Count)
         {
             dc.dcc = tempdclist.DataCaptureConfigurationList[index];
         }
         else
         {
             return;
         }
         dc.Adding             = false;
         dc.PassThroughDefined = PassThroughDefined;
         dc.ShowDialog();
         if (!dc.Cancelled)
         {
             tempdclist.DataCaptureConfigurationList.RemoveAt(index);
             tempdclist.DataCaptureConfigurationList.Insert(index, dc.dcc);
             dgvDataCap.Rows.Clear();
             PassThroughDefined = false;
             int cntr = 0;
             foreach (TroyDataCaptureConfiguration dcc in tempdclist.DataCaptureConfigurationList)
             {
                 AddToDataGrid(dcc, cntr);
                 cntr++;
             }
         }
     }
 }
예제 #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            DataCapture dc = new DataCapture();
            TroyDataCaptureConfiguration dcc = new TroyDataCaptureConfiguration();

            dc.dcc                = dcc;
            dc.Adding             = true;
            dc.PassThroughDefined = PassThroughDefined;
            dc.ShowDialog();
            if (!dc.Cancelled)
            {
                if (dcc.DataUse == DataUseType.PassThrough)
                {
                    PassThroughDefined = true;
                }
                tempdclist.DataCaptureConfigurationList.Add(dcc);
                AddToDataGrid(dcc, tempdclist.DataCaptureConfigurationList.Count - 1);
            }
        }