Пример #1
0
 /*描述:芯片信息添加按钮响应
  * 参数:略
  * 返回值:void
  */
 private void ChipAddButton_Click(object sender, EventArgs e)
 {
     //芯片集添加
     if (tabControl2.SelectedTab == tabPage3)
     {
         BoardInitForm_AddChipForm addChip = new BoardInitForm_AddChipForm();
         addChip.StartPosition = FormStartPosition.CenterScreen;
         addChip.ShowDialog();
         if (addChip.DialogResult == DialogResult.Yes)
         {
             ChipLvAddItems(addChip, addChip.Type, addChip.Model);
             addChip.Dispose();
         }
         return;
     }
     //交换机集添加
     if (tabControl2.SelectedTab == tabPage4)
     {
         BoardInitForm_AddInterChangeForm addInterChange = new BoardInitForm_AddInterChangeForm();
         addInterChange.StartPosition = FormStartPosition.CenterScreen;
         addInterChange.ShowDialog();
         if (addInterChange.DialogResult == DialogResult.Yes)
         {
             SWLvAddItems(addInterChange, addInterChange.Type, addInterChange.Model);
             addInterChange.Dispose();
         }
     }
 }
Пример #2
0
        /* 描述:芯片集添加项
         * 参数:
         * addChipItem----芯片集添加界面实例
         * 返回值:void
         */
        private void ChipLvAddItems(BoardInitForm_AddChipForm addChipItem, String str1, String str2)
        {
            _chipNum++;
            ChipLV.BeginUpdate();
            ListViewItem lvi = new ListViewItem();

            lvi.Text = _chipNum.ToString();
            lvi.SubItems.Add(str1);
            lvi.SubItems.Add(str2);
            ChipLV.Items.Add(lvi);
            ChipLV.EndUpdate();
        }