Пример #1
0
        private BreadcrumbItemCollection BuildDefaultItems()
        {
            BreadcrumbItemCollection result = new BreadcrumbItemCollection();

            if (this.Channel != null)
            {
                result.Add(new BreadcrumbItem()
                {
                    Name = this.Channel.Name, Url = "~/list/AllChannels.aspx"
                });

                if (this.Event != null)
                {
                    result.Add(new BreadcrumbItem()
                    {
                        Name = "事件列表", Url = string.Format("~/list/EventsInChannel.aspx?channelID={0}", this.Channel.ID)
                    });
                }
            }

            if (this.CurrentName.IsNotEmpty())
            {
                result.Add(new BreadcrumbItem()
                {
                    Name = this.CurrentName, Url = string.Empty
                });
            }

            return(result);
        }
Пример #2
0
        private void RenderBreadcrumbTrail()
        {
            this.header.Controls.Clear();

            BreadcrumbItemCollection items = this.Items;

            if (items.Count == 0)
            {
                items = BuildDefaultItems();
            }

            items.ForEach(item => AddItem(this.header, item.Name, this.ResolveUrl(item.Url)));
        }
Пример #3
0
        private BreadcrumbItemCollection BuildDefaultItems()
        {
            BreadcrumbItemCollection result = new BreadcrumbItemCollection();

            if (this.Channel != null)
            {
                result.Add(new BreadcrumbItem() { Name = this.Channel.Name, Url = "~/list/AllChannels.aspx" });

                if (this.Event != null)
                    result.Add(new BreadcrumbItem() { Name = "事件列表", Url = string.Format("~/list/EventsInChannel.aspx?channelID={0}", this.Channel.ID) });
            }

            if (this.CurrentName.IsNotEmpty())
                result.Add(new BreadcrumbItem() { Name = this.CurrentName, Url = string.Empty });

            return result;
        }