public ContentsPageModel(Page page, PagesCommonPart commonPart)
 {
     if (page != null)
     {
         this.Title = page.Title;
         this.Description = page.Description;
         this.ContentsMarkup = page.ContentsMarkup;
         if (page.Category != null)
         {
             ((IPage) this).CurrentCategoryUrl = page.Category.Url;
         }
         if (page.IsLargeSlideshowEnabled)
         {
             this.IsLargeSlideshowEnabled = page.IsLargeSlideshowEnabled;
             this.LargeSlideshowImages = page.PageLargeSlideshowImages.
                 Select(pi => pi.Image).ToList();
         }
         if (page.IsSmallSlideshowEnabled)
         {
             this.IsSmallSlideshowEnabled = page.IsSmallSlideshowEnabled;
             this.SmallSlideshowImages = page.PageSmallSlideshowImages.
                 Select(pi => pi.Image).ToList();
         }
     }
     else
     {
         this.Title = Config.DefaultPageName;
         this.ContentsMarkup = String.Empty;
     }
     ((IPage)this).CommonPart = commonPart ?? new PagesCommonPart();
     if (((IPage)this).CommonPart.Subscriber == null)
     {
         ((IPage)this).CommonPart.Subscriber = new Subscriber();
     }
 }
 public CategoryPageModel(PagesCommonPart commonPart, String currentCategoryUrl)
 {
     ((IPage) this).CommonPart = commonPart ?? new PagesCommonPart();
     if (((IPage)this).CommonPart.Subscriber == null)
     {
         ((IPage)this).CommonPart.Subscriber = new Subscriber();
     }
     ((IPage)this).CurrentCategoryUrl = currentCategoryUrl;
 }
 public SearchResultsPageModel(PagesCommonPart commonPart, String searchQuery)
 {
     this.SearchQuery = searchQuery;
     ((IPage) this).CommonPart = commonPart ?? new PagesCommonPart();
     if (((IPage)this).CommonPart.Subscriber == null)
     {
         ((IPage)this).CommonPart.Subscriber = new Subscriber();
     }
     ((IPage)this).CurrentCategoryUrl = null;
 }