Exemple #1
0
        public void addCategory(S6xNavHeaderCategory headerCategory, S6xNavCategoryLevel categoryLevel, string categoryName)
        {
            S6xNavCategory newNICateg = new S6xNavCategory(categoryName);

            if (categoryLevel == S6xNavCategoryLevel.ONE)
            {
                if (!slLists1[headerCategory].ContainsKey(newNICateg.Key))
                {
                    slLists1[headerCategory].Add(newNICateg.Key, newNICateg);
                }
            }
            else if (categoryLevel == S6xNavCategoryLevel.TWO)
            {
                if (!slLists2[headerCategory].ContainsKey(newNICateg.Key))
                {
                    slLists2[headerCategory].Add(newNICateg.Key, newNICateg);
                }
            }
            else if (categoryLevel == S6xNavCategoryLevel.THREE)
            {
                if (!slLists3[headerCategory].ContainsKey(newNICateg.Key))
                {
                    slLists3[headerCategory].Add(newNICateg.Key, newNICateg);
                }
            }
        }
Exemple #2
0
        public bool addCategory(S6xNavHeaderCategory headerCategory, S6xNavCategoryLevel categoryLevel, string categoryName)
        {
            S6xNavCategory newNICateg = new S6xNavCategory(categoryName);

            switch (categoryLevel)
            {
            case S6xNavCategoryLevel.ONE:
                if (slLists1[headerCategory].ContainsKey(newNICateg.Key))
                {
                    return(false);
                }
                slLists1[headerCategory].Add(newNICateg.Key, newNICateg);
                return(true);

            case S6xNavCategoryLevel.TWO:
                if (slLists2[headerCategory].ContainsKey(newNICateg.Key))
                {
                    return(false);
                }
                slLists2[headerCategory].Add(newNICateg.Key, newNICateg);
                return(true);

            case S6xNavCategoryLevel.THREE:
                if (slLists3[headerCategory].ContainsKey(newNICateg.Key))
                {
                    return(false);
                }
                slLists3[headerCategory].Add(newNICateg.Key, newNICateg);
                return(true);
            }
            return(false);
        }
Exemple #3
0
        public void AddNode(TreeNode tnNode, S6xNavCategory navCateg1, S6xNavCategory navCateg2, S6xNavCategory navCateg3, bool isNodeDuplicate)
        {
            if (isNodeDuplicate)
            {
                if (MainNode != null)
                {
                    if (!MainNode.Nodes.ContainsKey(tnNode.Name))
                    {
                        MainNode.Nodes.Add(tnNode);
                    }
                }
                return;
            }

            if (MainNode != null)
            {
                return;
            }

            TreeNode tnRightCateg = HeaderCategoryNode;
            TreeNode tnCateg      = null;

            if (navCateg1 != null)
            {
                tnCateg = tnRightCateg.Nodes[navCateg1.Key];
                if (tnCateg == null)
                {
                    tnCateg      = new TreeNode();
                    tnCateg.Name = navCateg1.Key;
                    tnCateg.Text = navCateg1.Name;
                    tnCateg.Tag  = navCateg1;
                    tnRightCateg.Nodes.Add(tnCateg);
                }
                tnRightCateg = tnCateg;

                if (navCateg2 != null)
                {
                    tnCateg = tnRightCateg.Nodes[navCateg2.Key];
                    if (tnCateg == null)
                    {
                        tnCateg      = new TreeNode();
                        tnCateg.Name = navCateg2.Key;
                        tnCateg.Text = navCateg2.Name;
                        tnCateg.Tag  = navCateg2;
                        tnRightCateg.Nodes.Add(tnCateg);
                    }
                    tnRightCateg = tnCateg;

                    if (navCateg3 != null)
                    {
                        tnCateg = tnRightCateg.Nodes[navCateg3.Key];
                        if (tnCateg == null)
                        {
                            tnCateg      = new TreeNode();
                            tnCateg.Name = navCateg3.Key;
                            tnCateg.Text = navCateg3.Name;
                            tnCateg.Tag  = navCateg3;
                            tnRightCateg.Nodes.Add(tnCateg);
                        }
                        tnRightCateg = tnCateg;
                    }
                }
            }

            tnRightCateg.Nodes.Add(tnNode);
        }