Пример #1
0
        public void Push(BreadCrumb bc)
        {
            if (bc.LinkName.IsNullOrWhiteSpace())
            {
                return;
            }
            if (bc.Url.IsNullOrWhiteSpace())
            {
                return;
            }
            if (bc.Url == "#")
            {
                return;
            }
            if (!BreadCrumbStack.IsNull())
            {
                if (BreadCrumbStack.Count > 0)
                {
                    if (BreadCrumbStack.Peek().Url == bc.Url)
                    {
                        return;
                    }
                }
            }

            BreadCrumbStack.Push(bc);
            SaveToMemory();
        }
Пример #2
0
 public BreadCrumb[] ToArray()
 {
     if (BreadCrumbStack.IsNull())
     {
         Console.WriteLine("BreadCrumbStack is null");
         return(null);
     }
     return(BreadCrumbStack.ToArray());
 }
Пример #3
0
        public BreadCrumb Pop()
        {
            if (BreadCrumbStack.Count() == 0)
            {
                Console.WriteLine("Stack is Empty!");
                return(null);
            }

            BreadCrumb bc = BreadCrumbStack.Pop();

            SaveToMemory();
            Console.WriteLine("Pop!");
            return(bc);
        }