Carrotware.CMS.Core.ContentPage.IsUniqueBlog C# (CSharp) Метод

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

public IsUniqueBlog ( ) : bool
Результат bool
        public bool IsUniqueBlog()
        {
            DateTime dateGoLive = Convert.ToDateTime(this.GoLiveDate);
            DateTime dateOrigGoLive = DateTime.MinValue;

            string thePageSlug = ContentPageHelper.ScrubFilename(this.Root_ContentID, this.PageSlug).ToLowerInvariant();

            string theFileName = thePageSlug;

            using (ContentPageHelper pageHelper = new ContentPageHelper()) {
                ContentPage cp = pageHelper.FindContentByID(SiteData.CurrentSite.SiteID, this.Root_ContentID);

                if (cp != null) {
                    dateOrigGoLive = cp.GoLiveDate;
                }
                if (cp == null && this.Root_ContentID != Guid.Empty) {
                    ContentPageExport cpe = ContentImportExportUtils.GetSerializedContentPageExport(this.Root_ContentID);
                    if (cpe != null) {
                        dateOrigGoLive = cpe.ThePage.GoLiveDate;
                    }
                }

                theFileName = ContentPageHelper.CreateFileNameFromSlug(SiteData.CurrentSite.SiteID, dateGoLive, thePageSlug);

                if (SiteData.IsPageSpecial(theFileName) || SiteData.IsLikelyHomePage(theFileName)) {
                    return false;
                }

                ContentPage fn1 = pageHelper.FindByFilename(SiteData.CurrentSite.SiteID, theFileName);

                if (cp == null && this.Root_ContentID != Guid.Empty) {
                    cp = pageHelper.GetVersion(SiteData.CurrentSite.SiteID, this.Root_ContentID);
                }

                if (fn1 == null || (fn1 != null && cp != null && fn1.Root_ContentID == cp.Root_ContentID)) {
                    return true;
                }
            }

            return false;
        }