Esempio n. 1
0
File: Form1.cs Progetto: viticm/pap2
        private void tree1_AfterSelNodesRemove(object sender, MWPropertyEventArgs e)
        {
            TreeNode node = e.Updated as TreeNode;

            // 检查是否大分类结点
            if (node.Tag is string)
            {
                return;
            }

            LogicObj lobj = node.Tag as LogicObj;
            if (lobj == null) // 删除一组
            {
                LogicObj onechild = node.Nodes[0].Tag as LogicObj;
                if (onechild != null)
                {
                    foreach (TreeNode n in node.Nodes)
                    {
                        this.previewform.m_panel1.RemoveODI(n.Text);
                    }
                }
            }
            else // 删除一个
            {
                this.previewform.m_panel1.RemoveODI(node.Text);
            }
        }
Esempio n. 2
0
File: Form1.cs Progetto: viticm/pap2
        private void tree1_AfterSelNodesAdd(object sender, MWPropertyEventArgs e)
        {
            TreeNode node = e.Updated as TreeNode;

            // 显示图片
            ShowMapContainSelectObj(node);

            // 检查是否大分类结点
            if (node.Tag is string)
            {
                return;
            }

            LogicObj lobj = node.Tag as LogicObj;
            if (lobj == null) // 添加一组
            {
                LogicObj onechild = node.Nodes[0].Tag as LogicObj;
                if (onechild != null)
                {
                    foreach (TreeNode n in node.Nodes)
                    {
                        LogicObj oneObj = n.Tag as LogicObj;
                        PointF pointf = LogicObjPosToImagePointF(oneObj);
                        int ndir = LogicObjToDirection(oneObj);
                        if (pointf != PointF.Empty)
                        {
                            ObjDrawInfo odi = new ObjDrawInfo(pointf, ndir, oneObj);
                            this.previewform.m_panel1.AddODI(n.Text, odi);
                        }
                    }
                }
            }
            else // 添加一个
            {
                PointF pointf = LogicObjPosToImagePointF(lobj);
                int ndir = LogicObjToDirection(lobj);
                if (pointf != PointF.Empty)
                {
                    ObjDrawInfo odi = new ObjDrawInfo(pointf, ndir, lobj);
                    this.previewform.m_panel1.AddODI(node.Text, odi);
                }
            }
        }