コード例 #1
0
        public void GetBreadCrumbs()
        {
            phBreadCrumbs.Controls.Clear();
            BreadCrumbs breadcrumbs = base.CurrentPortalPage.BreadCrumbs;

            if (BreadcrumbClassSetting != "")
            {
                breadcrumbs.CssClass = BreadcrumbClassSetting;
            }

            if (BreadcrumbSeparatorSetting != "")
            {
                breadcrumbs.Separator = BreadcrumbSeparatorSetting;
            }

            // Remove the number of levels set by the administrator
            if (RemoveLevelsSetting != 0)
            {
                int levels = breadcrumbs.Count - RemoveLevelsSetting;
                for (int i = breadcrumbs.Count; i > levels; i--)
                {
                    breadcrumbs.RemoveAt(i - 1);
                }
            }

            phBreadCrumbs.Controls.Add(new LiteralControl(breadcrumbs.ToString()));
        }
コード例 #2
0
        public void TestToStringWorksProperly()
        {
            BreadCrumbs crumbs = new BreadCrumbs(2);
            crumbs.Push("sam");
            crumbs.Push("hello");
            crumbs.Push("world");

            Assert.AreEqual(3, crumbs.Count());
            Assert.AreEqual("hello | world", crumbs.ToString());
        }
コード例 #3
0
 public void TestLinkedCrumbs()
 {
     BreadCrumbs crumbs = new BreadCrumbs(2);
     crumbs.Push("bob");
     crumbs.Push("linked", true);
     crumbs.Push("new");
     crumbs.Pop();
     Assert.AreEqual(1, crumbs.Count());
     Assert.AreEqual("bob", crumbs.ToString());
 }
コード例 #4
0
        public void TestLinkedCrumbs()
        {
            BreadCrumbs crumbs = new BreadCrumbs(2);

            crumbs.Push("bob");
            crumbs.Push("linked", true);
            crumbs.Push("new");
            crumbs.Pop();
            Assert.AreEqual(1, crumbs.Count());
            Assert.AreEqual("bob", crumbs.ToString());
        }
コード例 #5
0
        public void TestToStringWorksProperly()
        {
            BreadCrumbs crumbs = new BreadCrumbs(2);

            crumbs.Push("sam");
            crumbs.Push("hello");
            crumbs.Push("world");

            Assert.AreEqual(3, crumbs.Count());
            Assert.AreEqual("hello | world", crumbs.ToString());
        }