protected override void RenderContentAreaItem(HtmlHelper htmlHelper, ContentAreaItem contentAreaItem, string templateTag, string htmlTag,
                                                      string cssClass)
        {
            ViewContext viewContext = htmlHelper.ViewContext;
            IContent    content     = contentAreaItem.GetContent(this._contentRepository);

            if (content != null)
            {
                using (new ContentAreaContext(viewContext.RequestContext, content.ContentLink))
                {
                    TemplateModel templateModel = this.ResolveTemplate(htmlHelper, content, templateTag);
                    if ((templateModel != null) || this.IsInEditMode(htmlHelper))
                    {
                        TagBuilder tagBuilder = new TagBuilder(htmlTag);

                        SliderItemSettings itemSettings = viewContext.ViewData["sliderSettings"] as SliderItemSettings;
                        MergeSettings(tagBuilder, itemSettings);
                        if (contentAreaItem.RenderSettings.ContainsKey("sliderSettings"))
                        {
                            itemSettings = contentAreaItem.RenderSettings["sliderSettings"] as SliderItemSettings;
                            MergeSettings(tagBuilder, itemSettings);
                        }
                        // We can override settings per content item
                        tagBuilder.MergeAttributes(contentAreaItem.RenderSettings);

                        BeforeRenderContentAreaItemStartTag(tagBuilder, contentAreaItem);
                        viewContext.Writer.Write(tagBuilder.ToString(TagRenderMode.StartTag));

                        htmlHelper.RenderContentData(content, true, templateModel, _contentRenderer);

                        viewContext.Writer.Write(tagBuilder.ToString(TagRenderMode.EndTag));
                    }
                }
            }
        }
 protected virtual void MergeSettings(TagBuilder tagBuilder, SliderItemSettings sliderItemSettings)
 {
     if (sliderItemSettings != null)
     {
         tagBuilder.MergeAttribute("class", sliderItemSettings.CssClass);
         tagBuilder.Attributes["data-delay"] = sliderItemSettings.Delay.ToString();
     }
 }
 protected virtual void MergeSettings(TagBuilder tagBuilder, SliderItemSettings sliderItemSettings)
 {
     if (sliderItemSettings != null)
     {
         tagBuilder.MergeAttribute("class", sliderItemSettings.CssClass);
         tagBuilder.Attributes["data-delay"] = sliderItemSettings.Delay.ToString();
     }
 }