/// <summary>Creates a <c>div</c> tag for the given <paramref name="tag" />. /// Then sets the tag to be the container for a pager item (which, when clicked, rotates to its associated slide).</summary> /// <param name="tag">The tag whose content is being represented.</param> /// <param name="slide">The object from which to get the property.</param> /// <param name="resourceFile">The resource file from which to get localized resources.</param> /// <returns>The created pager item</returns> private Control CreatePagerItem(Tag tag, ITemplateable slide, string resourceFile) { Panel pagerItemWrapper = null; try { pagerItemWrapper = this.CreateRotatorContainer(tag, slide, resourceFile); pagerItemWrapper.CssClass = Utility.AddCssClass(pagerItemWrapper.CssClass, "pager-item-" + slide.GetValue("INDEX")); return(pagerItemWrapper); } catch { if (pagerItemWrapper != null) { pagerItemWrapper.Dispose(); } throw; } }
/// <summary>Creates a <c>div</c> tag for the given <paramref name="tag" />. /// Then sets the tag to pause rotation when clicked.</summary> /// <param name="tag">The tag whose content is being represented.</param> /// <param name="slide">The object from which to get the property.</param> /// <param name="resourceFile">The resource file from which to get localized resources.</param> /// <returns>The created pause button</returns> private Control CreatePauseButton(Tag tag, ITemplateable slide, string resourceFile) { Panel pauseButton = null; try { pauseButton = this.CreateRotatorContainer(tag, slide, resourceFile); pauseButton.CssClass = Utility.AddCssClass(pauseButton.CssClass, "rotator-pause"); return(pauseButton); } catch { if (pauseButton != null) { pauseButton.Dispose(); } throw; } }
/// <summary>Creates a <see cref="Label" /> whose content is the total number of <see cref="Slide" />s for this rotator.</summary> /// <param name="tag">The tag whose content is being represented.</param> /// <param name="slide">The object from which to get the property.</param> /// <param name="resourceFile">The resource file from which to get localized resources.</param> /// <returns>The <see cref="Label" /> instance that was created</returns> private static Control CreateTotalCountControl(Tag tag, ITemplateable slide, string resourceFile) { Label totalCountLabel = null; try { totalCountLabel = new Label(); totalCountLabel.CssClass = TemplateEngine.GetAttributeValue(tag, slide, null, resourceFile, "CssClass", "class"); totalCountLabel.CssClass = Utility.AddCssClass(totalCountLabel.CssClass, "total-slide-count"); return(totalCountLabel); } catch { if (totalCountLabel != null) { totalCountLabel.Dispose(); } throw; } }
/// <summary>Creates a <see cref="Label" /> whose content is the (1-based) index of the currently displayed <see cref="Slide" /></summary> /// <param name="tag">The tag whose content is being represented.</param> /// <param name="slide">The object from which to get the property.</param> /// <param name="resourceFile">The resource file from which to get localized resources.</param> /// <returns>The <see cref="Label" /> instance that was created</returns> private static Control CreateCurrentIndexControl(Tag tag, ITemplateable slide, string resourceFile) { Label currentSlideIndexWrapper = null; try { currentSlideIndexWrapper = new Label(); currentSlideIndexWrapper.CssClass = TemplateEngine.GetAttributeValue(tag, slide, null, resourceFile, "CssClass", "class"); currentSlideIndexWrapper.CssClass = Utility.AddCssClass(currentSlideIndexWrapper.CssClass, "current-slide-index"); currentSlideIndexWrapper.Text = 1.ToString(CultureInfo.CurrentCulture); return(currentSlideIndexWrapper); } catch { if (currentSlideIndexWrapper != null) { currentSlideIndexWrapper.Dispose(); } throw; } }
/// <summary>Creates a <c>div</c> tag for the given <paramref name="tag" />. /// Then sets the tag to be the container for an auto-generated pager.</summary> /// <param name="tag">The tag whose content is being represented.</param> /// <param name="slide">The object from which to get the property.</param> /// <param name="resourceFile">The resource file from which to get localized resources.</param> /// <returns>The created pager container</returns> private Control CreatePager(Tag tag, ITemplateable slide, string resourceFile) { Panel pagerContainer = null; try { pagerContainer = this.CreateRotatorContainer(tag, slide, resourceFile); pagerContainer.CssClass = Utility.AddCssClass(pagerContainer.CssClass, "rotator-pager"); this.CycleOptions.PagerEvent = TemplateEngine.GetAttributeValue(tag, slide, (ITemplateable)null, resourceFile, "Event") ?? "click"; return(pagerContainer); } catch { if (pagerContainer != null) { pagerContainer.Dispose(); } throw; } }