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


C# Image.ApplyStyleSheetSkin方法代码示例

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


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

示例1: GetRecentTopicIcon

        private Image GetRecentTopicIcon(Enumerators.PostStatus tStatus, int tReplies)
        {
            var image = new Image { ID = "postIcon" };

            switch (tStatus)
            {
                case Enumerators.PostStatus.Closed:
                    image.SkinID = "FolderNewLocked";

                    break;
                default:
                    image.SkinID = "FolderNew";
                    if (tReplies > Config.HotTopicNum)
                        image.SkinID = "FolderNewHot";
                    break;
            }
            image.GenerateEmptyAlternateText = true;
            image.ApplyStyleSheetSkin(Page);
            return image;
        }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:20,代码来源:Search.aspx.cs

示例2: GetRecentTopicIcon

    private Image GetRecentTopicIcon(TopicInfo topic, int tReplies)
    {
        var image = new Image { ID = "postIcon", EnableViewState = false };
        string _new = "";
        string hot = "";
        string locked = "";
        string sticky = "";

        if (topic.ReplyCount >= Config.HotTopicNum)
            hot = "Hot";
        switch ((Enumerators.PostStatus)topic.Status)
        {
            case Enumerators.PostStatus.Open:
                locked = "";
                image.ToolTip = webResources.lblOldPosts;
                break;
            case Enumerators.PostStatus.UnModerated:
                image.AlternateText = webResources.Unmoderatedpost;
                image.ToolTip = webResources.Unmoderatedpost;
                break;
            case Enumerators.PostStatus.OnHold:
                image.AlternateText = webResources.OnHold;
                image.ToolTip = webResources.OnHold;
                break;
            default:
                locked = "Locked";
                hot = "";
                image.AlternateText = webResources.lblLockedTopic;
                image.ToolTip = webResources.lblTopicLocked;
                break;
        }

        if (topic.IsSticky)
        {
            sticky = "Sticky";
            image.AlternateText = webResources.lblStickyTopic;
            image.ToolTip = locked == "" ? webResources.lblStickyTopic : webResources.lblStickyTopic + ", " + webResources.lblTopicLocked;
        }
        if (topic.LastPostDate > LastVisitDateTime)
        {
            image.AlternateText = webResources.lblNewPosts;
            image.ToolTip = webResources.lblNewPosts;
            _new = "New";
        }
        image.SkinID = "Folder" + _new + hot + sticky + locked;

        if (topic.Status == (int)Enumerators.PostStatus.UnModerated)
        {
            image.ToolTip = webResources.Unmoderatedpost;
            image.SkinID = "UnModerated";
        }
        if (topic.Status == (int)Enumerators.PostStatus.OnHold)
        {
            image.ToolTip = webResources.TopicOnHold;
            image.SkinID = "OnHold";
        }
        if (topic.UnModeratedReplies > 0)
        {
            image.ToolTip = webResources.UnmoderatedPosts;
            image.SkinID = "UnmoderatedPosts";
        }
        if (topic.PollId > 0)
        {
            image.ToolTip = Polls.lblPoll;
            image.SkinID = "Poll";
        }
        image.GenerateEmptyAlternateText = true;
        image.ApplyStyleSheetSkin(Page);
        if(Config.TopicAvatar)
            image.CssClass = image.CssClass + " icon-overlay";
        return image;
    }
开发者ID:huwred,项目名称:SnitzDotNet,代码行数:72,代码来源:active.aspx.cs


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