コード例 #1
0
        private void InitData()
        {
            try
            {
                TreeNode1 topNode = new TreeNode1(null, $"Top", null);
                topNode.NumDescendantEquations = 0;

                SelectedTreeLevels.Clear();
                CurrentlySelectedTreeLevel = new SelectedTreeLevel1(null, topNode, "");
                SelectedTreeLevels.Add(CurrentlySelectedTreeLevel);

                // Recursively build the tree information from the libraries
                foreach (var eqbLib in _vmEquations.EquationLibraries)
                {
                    TreeNode1 libTn = new TreeNode1(topNode, eqbLib.Name, null);
                    libTn.NumDescendantEquations = 0;

                    foreach (var sn in eqbLib.TopSectionNodes)
                    {
                        TreeNode1 tn = new TreeNode1(libTn, sn.Name, sn);

                        AddChildNodes(sn, tn);

                        libTn.NumDescendantEquations += tn.NumDescendantEquations;
                    }

                    topNode.NumDescendantEquations += libTn.NumDescendantEquations;
                }
            }
            catch (Exception ex)
            {
                Logging.LogException(ex);
                throw;
            }
        }
コード例 #2
0
        private void InitData()
        {
            try
            {
                TreeNode topNode = new TreeNode()
                {
                    Name   = $"Top",
                    Parent = null,
                };

                IList <TreeNode> topNodes = InitTree(topNode, "", 1, 5);

                SelectedTreeLevels.Clear();

                SelectedTreeLevels.Add(new SelectedTreeLevel(null, topNode));
            }
            catch (Exception ex)
            {
                Logging.LogException(ex);
                throw;
            }
        }