コード例 #1
0
        //修改构造
        public void DrawEditStruct()
        {
            GouzaoRecord record = new GouzaoRecord();
            string       id     = _DrawView.SelectedNode.Tag.ToString();

            record.Tag = new
            {
                type = "Edit",
                id   = _HLT.Drawing_Manage_Tree.Find(x => x.id == id).id
            };
            record.transf += (dynamic result) =>
            {
                _DrawView.SelectedNode.Text = result.name;
                Drawing_Manage drawing = _HLT.Drawing_Manage_Tree.Find(x => x.id == id);
                drawing.name = result.name;
            };
            record.ShowDialog();
        }
コード例 #2
0
        //新建构造
        public void DrawCreateStruct()
        {
            GouzaoRecord record = new GouzaoRecord();
            string       id     = _DrawView.SelectedNode.Tag.ToString();

            record.Tag = new
            {
                type = "",
            };
            record.transf += (dynamic result) =>
            {
                _HLT.Drawing_Manage_Tree.Add(new Drawing_Manage
                {
                    id   = result.id,
                    pid  = _HLT.Drawing_Manage_Tree.Find(x => x.type == Drawing_type.构造配置).id,
                    name = result.name,
                    type = Drawing_type.配置,
                });
                _DrawView.SelectedNode.Nodes.Add(new TreeNode {
                    Tag = result.id, Text = result.name
                });
            };
            record.ShowDialog();
        }