private void ShowNodeItem(TreeListNode treeListNode) { object _selectedItem = treeListNode.GetValue(this.treeListColumn1); if (_selectedItem is MD_QueryModel) { ShowQueryModelInfo(_selectedItem as MD_QueryModel); } else if (_selectedItem is MD_ViewTable) { MD_ViewTable _vt = _selectedItem as MD_ViewTable; if (_vt.ViewTableType == MDType_ViewTable.MainTable) { ShowTableInfo(_vt); } else { ShowTableInfo(_vt); } } else { this.panel1.Controls.Clear(); CurrentItem = null; } }
private void ChangePanelContext() { if (this.panel1.Controls.Count > 0) { object _obj = this.panel1.Controls[0]; if (_obj is IControlMenu) { IControlMenu _ic = _obj as IControlMenu; _ic.CloseControl(); } } }
private void ShowQueryModelInfo(MD_QueryModel _qv) { SinoUC_QME_QueryModelInfo _uc = new SinoUC_QME_QueryModelInfo(); _uc.DataChanged += new EventHandler <EventArgs>(_uc_DataChanged); _uc.MenuChanged += new EventHandler <EventArgs>(_uc_MenuChanged); _uc.InitData(_qv); _uc.Dock = DockStyle.Fill; this.panel1.Controls.Clear(); this.panel1.Controls.Add(_uc); CurrentItem = _uc as IControlMenu; }
private void ShowTableInfo(MD_ViewTable _vt) { SinoUC_QME_TableInfo _uc = new SinoUC_QME_TableInfo(CurrentNode); _uc.DataChanged += new EventHandler <EventArgs>(_uc_DataChanged); _uc.MenuChanged += new EventHandler <EventArgs>(_uc_MenuChanged); _uc.DataSaved += new EventHandler <EventArgs>(_uc_DataSaved); _uc.InitData(_vt); _uc.Dock = DockStyle.Fill; this.panel1.Controls.Clear(); this.panel1.Controls.Add(_uc); CurrentItem = _uc as IControlMenu; }
private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e) { CurrentNode = e.Node; if (CurrentItem != null) { CurrentItem.CloseControl(); } if (e.Node != null) { ShowNodeItem(e.Node); } else { this.panel1.Controls.Clear(); CurrentItem = null; } RaiseMenuChanged(); }