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());
 }
Exemplo n.º 2
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());
        }
Exemplo n.º 3
0
        protected override void LoadPage(object target, string source, IDictionary <string, object> sourceData, IDictionary <string, object> uiProperties, bool navigateForward)
        {
            this.Application.NavigatingForward = navigateForward;

            Item currentItem = GetCurrentItem(uiProperties);

            if (navigateForward)
            {
                string current = "";

                if (breadcrumbs.Count == 0)
                {
                    current = Config.Instance.InitialBreadcrumbName;
                }

                else if (currentItem != null)
                {
                    current = currentItem.Name;
                }

                //check to see if we are going to the PIN page
                else if (source == "resx://MediaBrowser/MediaBrowser.Resources/ParentalPINEntry")
                {
                    //put special breadcrumb in that we will not show
                    current = "PINENTRY";
                }
                breadcrumbs.Push(current);
            }
            else
            {
                if (breadcrumbs.Count > 0)
                {
                    breadcrumbs.Pop();
                }
                //clear out the protected folder list each time we go back to the root
                if ((uiProperties != null) && (uiProperties.ContainsKey("Folder")))
                {
                    FolderModel folder = currentItem as FolderModel;

                    //keep track of current folder on back
                    Application.CurrentInstance.CurrentFolder = folder;

                    if (folder.IsRoot)
                    {
                        //we're backing into the root folder - clear the protected folder list
                        Kernel.Instance.ClearProtectedAllowedList();
                    }
                }
            }

            base.LoadPage(target, source, sourceData, uiProperties, navigateForward);

            Application.CurrentInstance.OnNavigationInto(currentItem);
        }
Exemplo n.º 4
0
        protected override void LoadPage(object target, string source, IDictionary <string, object> sourceData, IDictionary <string, object> uiProperties, bool navigateForward)
        {
            this.Application.NavigatingForward = navigateForward;

            Item currentItem = GetCurrentItem(uiProperties);

            AtRoot = currentItem == Application.CurrentInstance.RootFolderModel;

            if (navigateForward)
            {
                string current = currentItem != null ? currentItem.Name : "";

                //check to see if we are going to the PIN page
                if (source == "resx://MediaBrowser/MediaBrowser.Resources/ParentalPINEntry")
                {
                    //put special breadcrumb in that we will not show
                    current = "PINENTRY";
                }
                breadcrumbs.Push(current);
            }
            else
            {
                if (breadcrumbs.Count > 0)
                {
                    breadcrumbs.Pop();
                }
                //clear out the protected folder list each time we go back to the root
                if ((uiProperties != null) && (uiProperties.ContainsKey("Folder")))
                {
                    FolderModel folder = currentItem as FolderModel;

                    //keep track of current folder on back
                    Application.CurrentInstance.CurrentFolder = folder;
                }

                //stop backdrops if out of scope
                if (currentItem != null)
                {
                    Application.CurrentInstance.BackdropController.StopIfOutOfScope(currentItem.BaseItem);
                }
            }

            base.LoadPage(target, source, sourceData, uiProperties, navigateForward);

            Application.CurrentInstance.OnNavigationInto(currentItem);
        }