Exemplo n.º 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();
         }
     }
 }
Exemplo n.º 2
0
        /* 描述:交换机集添加项
         * 参数:
         * addSWItem----交换机集添加界面实例
         * 返回值:void
         */
        private void SWLvAddItems(BoardInitForm_AddInterChangeForm addSWItem, String str1, String str2)
        {
            _swNum++;
            SWLV.BeginUpdate();
            ListViewItem lvi = new ListViewItem();

            lvi.Text = _swNum.ToString();
            lvi.SubItems.Add(str1);
            lvi.SubItems.Add(str2);
            SWLV.Items.Add(lvi);
            SWLV.EndUpdate();
        }