예제 #1
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     //删除当前选中的层(问题:当前激活的层是否可以删除?)
     ListView.SelectedIndexCollection sel = LayerList.SelectedIndices;
     if (sel.Count > 0)
     {
         if (DialogResult.Yes == MessageBox.Show("删除工作层时会删除层中的所有对象,是否确定要删除?", "警告", MessageBoxButtons.YesNo))
         {
             // 删除编辑器中对应的层
             EXListViewSubItemBase item = LayerList.ItemList[sel[0]].SubItemList[0];
             string name = item.Text;
             Program.engine.MainLevel.RemoveLayer(name);
             LayerList.RemoveItem(sel[0]);
         }
     }
     OperationTooltip.Text = "就绪";
 }