public void Show() { try { int moduleid = Helper.Client.InvokeSync <int>("GetDBModuleID", this.m_data.ID.Value); if (moduleid != 0) { TreeNode.DBModuleNode node = MainWindow.instance.FindDBModule(moduleid); if (node != null) { node.ShowTable(this.m_data.ID.Value); } } else { TreeNode.DBTableNode tableNode = MainWindow.instance.FindDBTable(m_data.ID.Value); if (tableNode != null) { tableNode.OnDoubleClick(null, null); } } } catch (Exception ex) { Helper.ShowError(ex); } }
public void Show() { TreeNode.DBModuleNode node = MainWindow.instance.FindDBModule(m_data.ID.Value); if (node != null) { node.OnDoubleClick(null, null); } }
public ModuleDocument(TreeNode.DBModuleNode moduleNode) { this.ModuleNode = moduleNode; this.DataContext = moduleNode; this.SetBinding(TabItem.HeaderProperty, "Name"); ScrollViewer scrollview = new ScrollViewer(); scrollview.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; scrollview.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; this.Content = scrollview; Grid mainGrid = new Grid(); scrollview.Content = mainGrid; mainGrid.AllowDrop = true; mainGrid.Background = Brushes.White; mainGrid.Drop += m_Grid_Drop; mainGrid.MouseDown += mainGrid_MouseDown; m_canvas = new Canvas(); m_canvas.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; m_canvas.VerticalAlignment = System.Windows.VerticalAlignment.Stretch; mainGrid.Children.Add(m_canvas); m_Grid = new Grid(); m_Grid.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; m_Grid.VerticalAlignment = System.Windows.VerticalAlignment.Stretch; mainGrid.Children.Add(m_Grid); bindTables(); CreateContextMenu(); this.LayoutUpdated += ModuleDocument_LayoutUpdated; }