Esempio n. 1
0
        private void buttonDel_Click(object sender, EventArgs e) // 删除
        {
            if (this.advTreePoly.SelectedNode == null)
            {
                MessageBox.Show("未选中任何结点");
                return;
            }

            _AtlObjInfo selectedinfo = (_AtlObjInfo)this.advTreePoly.SelectedNode.Tag;

            if (this.advTreePoly.SelectedNode.Parent.Text == "多边形")
            {
                //m_doc.DocLogical.DeleteSelectedPoly();
                m_doc.DocLogical.DeleteSelectedObject();
                //this.advTreePoly.SelectedNode.Remove();
            }
            else if (this.advTreePoly.SelectedNode.Parent.Text == "笔刷")
            {
                int iMask = Convert.ToInt32(selectedinfo.strValues[4]);
                if (iMask != 0)
                {
                    SceneSceneEditor.DeleteCurrentCellInfo();

                    int iID = Convert.ToInt32(selectedinfo.strValues[0]);
                    m_doc.DocLogical.DeleteOneLogicalBrush(iID);

                    this.advTreePoly.Nodes.Remove(this.advTreePoly.SelectedNode);
                    this.advTreePoly.SelectedNode.Remove();
                }
            }
        }