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


C# ExtendedUserData.ToString方法代码示例

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


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

示例1: GetBlogHeadingFromURL

        public PageViewType GetBlogHeadingFromURL(SiteData currentSite, string sFilterPath)
        {
            Guid siteID = currentSite.SiteID;
            PageViewType pvt = new PageViewType { ExtraTitle = "", CurrentViewType = PageViewType.ViewType.SinglePage, RawValue = null };

            string sTitle = String.Empty;

            if (currentSite.CheckIsBlogCategoryPath(sFilterPath)) {
                pvt.CurrentViewType = PageViewType.ViewType.CategoryIndex;
                vw_carrot_CategoryURL query = CompiledQueries.cqGetCategoryByURL(db, siteID, sFilterPath);
                if (query != null) {
                    sTitle = query.CategoryText;
                    pvt.RawValue = query.CategoryText;
                }
            }
            if (currentSite.CheckIsBlogTagPath(sFilterPath)) {
                pvt.CurrentViewType = PageViewType.ViewType.TagIndex;
                vw_carrot_TagURL query = CompiledQueries.cqGetTagByURL(db, siteID, sFilterPath);
                if (query != null) {
                    sTitle = query.TagText;
                    pvt.RawValue = query.TagText;
                }
            }
            if (currentSite.CheckIsBlogEditorFolderPath(sFilterPath)) {
                pvt.CurrentViewType = PageViewType.ViewType.AuthorIndex;
                vw_carrot_EditorURL query = CompiledQueries.cqGetEditorByURL(db, siteID, sFilterPath);
                if (query != null) {
                    ExtendedUserData usr = new ExtendedUserData(query.UserId);
                    sTitle = usr.ToString();
                    pvt.RawValue = usr;
                }
            }
            if (currentSite.CheckIsBlogDateFolderPath(sFilterPath)) {
                pvt.CurrentViewType = PageViewType.ViewType.DateIndex;

                BlogDatePathParser p = new BlogDatePathParser(currentSite, sFilterPath);
                TimeSpan ts = p.DateEndUTC - p.DateBeginUTC;

                pvt.RawValue = p.DateBegin;

                int daysDelta = ts.Days;
                if (daysDelta < 400 && daysDelta > 90) {
                    sTitle = p.DateBegin.ToString("yyyy");
                    pvt.CurrentViewType = PageViewType.ViewType.DateYearIndex;
                }
                if (daysDelta < 36 && daysDelta > 3) {
                    sTitle = p.DateBegin.ToString("MMMM yyyy");
                    pvt.CurrentViewType = PageViewType.ViewType.DateMonthIndex;
                }
                if (daysDelta < 5) {
                    sTitle = p.DateBegin.ToString("MMMM d, yyyy");
                    pvt.CurrentViewType = PageViewType.ViewType.DateDayIndex;
                }
            }

            if (currentSite.CheckIsSiteSearchPath(sFilterPath)) {
                pvt.CurrentViewType = PageViewType.ViewType.SearchResults;
                string sSearchTerm = "";

                if (HttpContext.Current.Request.QueryString[SiteData.SearchQueryParameter] != null) {
                    sSearchTerm = HttpContext.Current.Request.QueryString[SiteData.SearchQueryParameter].ToString();
                }

                pvt.RawValue = sSearchTerm;
                sTitle = string.Format(" '{0}' ", sSearchTerm);
            }

            pvt.ExtraTitle = sTitle;

            return pvt;
        }
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:71,代码来源:ContentPageHelper.cs

示例2: GetBlogHeadingFromURL

        public string GetBlogHeadingFromURL(SiteData currentSite, string sFilterPath)
        {
            Guid siteID = currentSite.SiteID;

            string sTitle = String.Empty;

            if (currentSite.CheckIsBlogCategoryPath(sFilterPath)) {
                vw_carrot_CategoryURL query = CompiledQueries.cqGetCategoryByURL(db, siteID, sFilterPath);
                sTitle = query.CategoryText;
            }
            if (currentSite.CheckIsBlogTagPath(sFilterPath)) {
                vw_carrot_TagURL query = CompiledQueries.cqGetTagByURL(db, siteID, sFilterPath);
                sTitle = query.TagText;
            }
            if (currentSite.CheckIsBlogEditorFolderPath(sFilterPath)) {
                vw_carrot_EditorURL query = CompiledQueries.cqGetEditorByURL(db, siteID, sFilterPath);
                ExtendedUserData usr = new ExtendedUserData(query.UserId);
                sTitle = usr.ToString();
            }
            if (currentSite.CheckIsBlogDateFolderPath(sFilterPath)) {
                BlogDatePathParser p = new BlogDatePathParser(currentSite, sFilterPath);
                TimeSpan ts = p.DateEndUTC - p.DateBeginUTC;

                int daysDelta = ts.Days;
                if (daysDelta > 90) {
                    sTitle = "Year " + p.DateBegin.ToString("yyyy");
                }
                if (daysDelta < 36) {
                    sTitle = p.DateBegin.ToString("MMMM yyyy");
                }
                if (daysDelta < 5) {
                    sTitle = p.DateBegin.ToString("MMMM d, yyyy");
                }
            }
            if (currentSite.CheckIsSiteSearchPath(sFilterPath)) {
                sTitle = "Search Results";
            }

            return sTitle;
        }
开发者ID:sunsiz,项目名称:CarrotCakeCMS-MVC,代码行数:40,代码来源:SiteNavHelperReal.cs


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