コード例 #1
0
 private void menu_ShowMain_Click(object sender, System.EventArgs e)
 {
     try
     {
         if (this.listView1.SelectedItems.Count < 1)
         {
             MessageBox.Show(this, "请先选择数据项!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             return;
         }
         int count = 0;
         foreach (ListViewItem item in this.listView1.SelectedItems)
         {
             string Guid = item.SubItems[0].Text;
             addin.DeleteAddIn(Guid);
             listView1.Items.Remove(listView1.SelectedItems[0]);
             count++;
         }
         BindlistView();
         LoadAddinFile();
         MessageBox.Show(this, count + "项已删除。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(this, "删除失败,请重试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         LogInfo.WriteLog(ex);
     }
 }