Carrotware.CMS.Mvc.UI.Admin.Models.SiteImportNativeModel.SiteImportNativeModel C# (CSharp) Méthode

SiteImportNativeModel() public méthode

public SiteImportNativeModel ( ) : System
Résultat System
        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.Any() && dictTemplates.First().Value >= iThird) {
                        try { this.PageTemplate = dictTemplates.First().Key; } catch { }
                    }

                    dictTemplates = pageHelper.GetPopularTemplateList(SiteData.CurrentSiteID, ContentPageType.PageType.BlogEntry);
                    if (dictTemplates.Any()) {
                        try { this.PostTemplate = dictTemplates.First().Key; } catch { }
                    }
                }
            }
        }

Same methods

SiteImportNativeModel::SiteImportNativeModel ( System.Guid importId ) : System