private void CreatePanelbarItem(PanelBarItemFactory item, AccordionItemContainer accordionItem, IAccordionContentSpecificationProcessor specificationProcessor)
        {
            var content = specificationProcessor.GetContent(accordionItem);

            item.Add().Text(accordionItem.Title).Expanded(accordionItem.Expanded)
            .Content(content);
        }
Пример #2
0
        public string GetContent(AccordionItemContainer container)
        {
            var contentSpecifications = GetContentSpecifications();
            var contentSpecifier      = contentSpecifications.First(specification => specification.IsSatisifiedBy(container));

            return(contentSpecifier.GetContent(container));
        }
Пример #3
0
 public AccordionItemContentConfigurator(IAccordionItemConfigurator configurator, AccordionItemContainer accordionItemContainer)
 {
     configurator.Guard("AccordionItemConfigurator must not be null.");
     accordionItemContainer.Guard("AccordionItemContainer must not be null.");
     _configurator           = configurator;
     _accordionItemContainer = accordionItemContainer;
 }
        public IAccordionItemContentConfigurator ItemFor(string title)
        {
            title.Guard("Title must not be not null or empty.");
            var item = new AccordionItemContainer {
                Title = title,
            };

            _configurationContainer.Contents.Add(item);
            return(new AccordionItemContentConfigurator(this, item));
        }
 public bool IsSatisifiedBy(AccordionItemContainer container)
 {
     return((container.Content as MvcHtmlString) != null);
 }
        public string GetContent(AccordionItemContainer container)
        {
            var content = (MvcHtmlString)container.Content;

            return(string.Format("<br/>{0}<br/>", content.ToHtmlString()));
        }
 public bool IsSatisifiedBy(AccordionItemContainer container)
 {
     return((container.Content as Func <object, object>) != null);
 }
        public string GetContent(AccordionItemContainer container)
        {
            var content = (Func <object, object>)container.Content;

            return(string.Format("<br/>{0}<br/>", content(new object())));
        }