Esempio n. 1
0
 protected override void OnDrawItem(DrawItemEventArgs e)
 {
     e.DrawBackground();
     if (e.Index >= 0)
     {
         using (SolidBrush b = new SolidBrush(e.ForeColor))
         {
             Type type = Items[e.Index] as Type;
             e.Graphics.DrawImage(Res.GetImage(DataTreeHelper.GetTypeImageIndex(type)), e.Bounds.Location);
             e.Graphics.DrawString(type.Name, e.Font, b, e.Bounds.X + 20, e.Bounds.Y);
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dictionary"></param>
        public void CreateNodes(Dictionary dictionary)
        {
            Nodes.Clear();
            if (ShowNone)
            {
                TreeNode noneNode = Nodes.Add(Res.Get("Misc,None"));
                noneNode.ImageIndex         = 76;
                noneNode.SelectedImageIndex = noneNode.ImageIndex;
            }
            if (ShowVariables || ShowParameters || ShowTotals)
            {
                if (ShowDataSources)
                {
                    TreeNode dataNode = Nodes.Add(Res.Get("Designer,ToolWindow,Dictionary,DataSources"));
                    dataNode.ImageIndex         = 53;
                    dataNode.SelectedImageIndex = dataNode.ImageIndex;
                    DataTreeHelper.CreateDataTree(dictionary, dataNode.Nodes, ShowEnabledOnly, ShowRelations, ShowDataSources,
                                                  ShowColumns);
                }

                if (ShowParameters && dictionary.Parameters.Count > 0)
                {
                    TreeNode parNode = Nodes.Add(Res.Get("Designer,ToolWindow,Dictionary,Parameters"));
                    parNode.ImageIndex         = 234;
                    parNode.SelectedImageIndex = parNode.ImageIndex;
                    DataTreeHelper.CreateParametersTree(dictionary.Parameters, parNode.Nodes);
                }

                if (ShowVariables)
                {
                    TreeNode sysNode = Nodes.Add(Res.Get("Designer,ToolWindow,Dictionary,SystemVariables"));
                    sysNode.ImageIndex         = 60;
                    sysNode.SelectedImageIndex = sysNode.ImageIndex;
                    DataTreeHelper.CreateVariablesTree(dictionary.SystemVariables, sysNode.Nodes);
                }

                if (ShowFunctions)
                {
                    TreeNode funcNode = Nodes.Add(Res.Get("Designer,ToolWindow,Dictionary,Functions"));
                    funcNode.ImageIndex         = 52;
                    funcNode.SelectedImageIndex = funcNode.ImageIndex;
                    DataTreeHelper.CreateFunctionsTree(dictionary.Report, funcNode.Nodes);
                }

                if (ShowTotals && dictionary.Totals.Count > 0)
                {
                    TreeNode sumNode = Nodes.Add(Res.Get("Designer,ToolWindow,Dictionary,Totals"));
                    sumNode.ImageIndex         = 132;
                    sumNode.SelectedImageIndex = sumNode.ImageIndex;
                    DataTreeHelper.CreateTotalsTree(dictionary.Totals, sumNode.Nodes);
                }

                if (ShowDialogs)
                {
                    DataTreeHelper.CreateDialogControlsTree(dictionary.Report, Nodes);
                }
            }
            else
            {
                DataTreeHelper.CreateDataTree(dictionary, Nodes, ShowEnabledOnly, ShowRelations, ShowDataSources, ShowColumns);
            }
        }