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(); }
public BreadCrumb[] ToArray() { if (BreadCrumbStack.IsNull()) { Console.WriteLine("BreadCrumbStack is null"); return(null); } return(BreadCrumbStack.ToArray()); }
public BreadCrumb Pop() { if (BreadCrumbStack.Count() == 0) { Console.WriteLine("Stack is Empty!"); return(null); } BreadCrumb bc = BreadCrumbStack.Pop(); SaveToMemory(); Console.WriteLine("Pop!"); return(bc); }