当前位置: 首页>>代码示例>>C#>>正文


C# Label.Dispose方法代码示例

本文整理汇总了C#中System.Web.UI.WebControls.Label.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Label.Dispose方法的具体用法?C# Label.Dispose怎么用?C# Label.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.WebControls.Label的用法示例。


在下文中一共展示了Label.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateTotalCountControl

        /// <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;
            }
        }
开发者ID:EngageSoftware,项目名称:Engage-Rotator,代码行数:25,代码来源:Rotator.ascx.cs

示例2: CreateCurrentIndexControl

        /// <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;
            }
        }
开发者ID:EngageSoftware,项目名称:Engage-Rotator,代码行数:26,代码来源:Rotator.ascx.cs


注:本文中的System.Web.UI.WebControls.Label.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。