示例#1
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            LibTreeNode libnode = (LibTreeNode)e.Node;

            if (libnode == null)
            {
                return;
            }
            bool exists = false;

            switch (libnode.NodeType)
            {
            case NodeType.TransSetting:
                if (this._tranproperty == null)
                {
                    _tranproperty = new TransProperty();
                    this.splitContainer1.Panel2.Controls.Add(_tranproperty);
                }
                SetPanel2ControlsVisible(_tranproperty);

                _Trans.TransName = string.IsNullOrEmpty(_Trans.TransName) ? _funNode.Text : _Trans.TransName;
                _Trans.Package   = string.IsNullOrEmpty(_Trans.Package) ? _funNode.Package : _Trans.Package;
                //if (ModelDesignProject.ExitsDataSource(_fm.FormId, _fm.Package))
                //{
                //    _fm.DSID = _fm.FormId;
                //}
                _tranproperty.SetPropertyValue(_Trans, libnode);
                break;

            case NodeType.TransField:
                if (_transFieldlst != null)
                {
                    foreach (TransFieldProperty item in _transFieldlst)
                    {
                        if (string.Compare(item.Name, libnode.NodeId) == 0)
                        {
                            SetPanel2ControlsVisible(item);
                            exists = true;
                            break;
                        }
                    }
                    if (!exists)     //还未创建对应的控件
                    {
                        TransFieldProperty transfdp = new TransFieldProperty(libnode.NodeId);
                        transfdp.Dock = DockStyle.Fill;
                        this._transFieldlst.Add(transfdp);
                        this.splitContainer1.Panel2.Controls.Add(transfdp);
                        //LibReportGrid librptgd = _rpt.GridGroups.FindFirst("GridGroupID", ((LibTreeNode)libnode.Parent).NodeId);
                        transfdp.SetPropertyValue(_Trans.TransFields.FindFirst("ID", libnode.NodeId), libnode);

                        SetPanel2ControlsVisible(transfdp);
                    }
                }
                break;
            }
        }
示例#2
0
        public TransSourceControl(LibTreeNode funcNode)
            : this()
        {
            this._funNode      = funcNode;
            _tranproperty      = new TransProperty();
            _transFieldlst     = new List <TransFieldProperty>();
            _tranproperty.Dock = DockStyle.Fill;

            this.splitContainer1.Panel2.Controls.Add(_tranproperty);
        }