コード例 #1
0
 private void buttonApply_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (DataGridViewRow itemRow in dataGridViewComponents.Rows)
         {
             string       key       = ((COMComponent)itemRow.Tag).Key;
             COMComponent component = GetComponentByKey(key);
             component.Description      = (string)itemRow.Cells[1].Value;
             component.VersionAttribute = (string)itemRow.Cells[2].Value;
         }
     }
     catch (Exception throwedException)
     {
         FormShowError errorForm = new FormShowError(throwedException);
         errorForm.ShowDialog(this);
     }
 }
コード例 #2
0
        private void dataGridViewComponents_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if ((e.RowIndex < 0) || (true == _initializeFlag))
                {
                    return;
                }

                DataGridViewRow selectRow       = dataGridViewComponents.Rows[e.RowIndex];
                COMComponent    selectComponent = (COMComponent)selectRow.Tag;

                selectComponent.Description      = (string)selectRow.Cells[1].Value;
                selectComponent.VersionAttribute = (string)selectRow.Cells[2].Value;
            }
            catch (Exception throwedException)
            {
                FormShowError errorForm = new FormShowError(throwedException);
                errorForm.ShowDialog(this);
            }
        }