private void UpdateTree() { FUpdating = true; tvTables.BeginUpdate(); tvTables.Nodes.Clear(); tvTables.Sorted = false; lblWait.Location = new Point(tvTables.Left + 1, tvTables.Top + tvTables.Height / 2 - 32); lblWait.Size = new Size(tvTables.Width - 2, 32); lblWait.Visible = true; lblWait.Refresh(); try { FConnection.CreateAllTables(false); } catch { } lblWait.Visible = false; btnAddQuery.Enabled = Connection.IsSqlBased; DataTreeHelper.CreateDataTree(FReport.Dictionary, Connection, tvTables.Nodes); tvTables.EndUpdate(); tvTables.Sort(); FUpdating = false; }
private void UpdateTree() { FExpandedNodes.Clear(); GetExpandedNodes(FTree.Nodes); TreeView buffer = new TreeView(); if (FReport != null) { bool canShowData = FReport.Dictionary.Connections.Count > 0; foreach (DataSourceBase data in FReport.Dictionary.DataSources) { if (data.Enabled) { canShowData = true; break; } } TreeNode rootNode = null; if (canShowData) { rootNode = buffer.Nodes.Add(Res.Get("Designer,ToolWindow,Dictionary,DataSources")); rootNode.Tag = FReport.Dictionary.DataSources; rootNode.ImageIndex = 53; rootNode.SelectedImageIndex = rootNode.ImageIndex; DataTreeHelper.CreateDataTree(FReport.Dictionary, rootNode.Nodes, true, true, true, true); } // system variables rootNode = buffer.Nodes.Add(Res.Get("Designer,ToolWindow,Dictionary,SystemVariables")); rootNode.Tag = FReport.Dictionary.SystemVariables; rootNode.ImageIndex = 60; rootNode.SelectedImageIndex = rootNode.ImageIndex; DataTreeHelper.CreateVariablesTree(FReport.Dictionary.SystemVariables, rootNode.Nodes); // totals rootNode = buffer.Nodes.Add(Res.Get("Designer,ToolWindow,Dictionary,Totals")); rootNode.Tag = FReport.Dictionary.Totals; rootNode.ImageIndex = 132; rootNode.SelectedImageIndex = rootNode.ImageIndex; DataTreeHelper.CreateTotalsTree(FReport.Dictionary.Totals, rootNode.Nodes); // parameters rootNode = buffer.Nodes.Add(Res.Get("Designer,ToolWindow,Dictionary,Parameters")); rootNode.Tag = FReport.Dictionary.Parameters; rootNode.ImageIndex = 234; rootNode.SelectedImageIndex = rootNode.ImageIndex; DataTreeHelper.CreateParametersTree(FReport.Dictionary.Parameters, rootNode.Nodes); // functions rootNode = buffer.Nodes.Add(Res.Get("Designer,ToolWindow,Dictionary,Functions")); rootNode.ImageIndex = 52; rootNode.SelectedImageIndex = rootNode.ImageIndex; DataTreeHelper.CreateFunctionsTree(FReport, rootNode.Nodes); } if (!CompareNodes(buffer.Nodes, FTree.Nodes)) { FTree.BeginUpdate(); FTree.Nodes.Clear(); CopyNodes(buffer.Nodes, FTree.Nodes); FTree.EndUpdate(); } buffer.Dispose(); UpdateControls(); }