Carrotware.CMS.Core.ContentPageHelper.GetPopularTemplateList C# (CSharp) Метод

GetPopularTemplateList() публичный Метод

public GetPopularTemplateList ( System.Guid siteID, ContentPageType pageType ) : float>.Dictionary
siteID System.Guid
pageType ContentPageType
Результат float>.Dictionary
        public Dictionary<string, float> GetPopularTemplateList(Guid siteID, ContentPageType.PageType pageType)
        {
            Dictionary<string, float> lstTemps = CannedQueries.GetTemplateCounts(db, siteID, pageType);

            return lstTemps;
        }

Usage Example

        public SiteImportNativeModel()
        {
            this.CreateUsers = true;
            this.MapUsers = true;
            this.HasLoaded = false;

            using (ContentPageHelper pageHelper = new ContentPageHelper()) {
                this.PageCount = pageHelper.GetSitePageCount(SiteData.CurrentSiteID, ContentPageType.PageType.ContentEntry);

                using (CMSConfigHelper cmsHelper = new CMSConfigHelper()) {
                    this.Templates = cmsHelper.Templates;

                    float iThird = (float)(this.PageCount - 1) / (float)3;
                    Dictionary<string, float> dictTemplates = null;

                    dictTemplates = pageHelper.GetPopularTemplateList(SiteData.CurrentSiteID, ContentPageType.PageType.ContentEntry);
                    if (dictTemplates.Count > 0 && dictTemplates.First().Value >= iThird) {
                        try { this.PageTemplate = dictTemplates.First().Key; } catch { }
                    }

                    dictTemplates = pageHelper.GetPopularTemplateList(SiteData.CurrentSiteID, ContentPageType.PageType.BlogEntry);
                    if (dictTemplates.Count > 0) {
                        try { this.PostTemplate = dictTemplates.First().Key; } catch { }
                    }
                }
            }
        }
All Usage Examples Of Carrotware.CMS.Core.ContentPageHelper::GetPopularTemplateList