Exemplo n.º 1
0
        public PageVariableData(PageTemplateSection pageTemplateSection, PageSection pageSectionOrNull)
        {
            if (pageTemplateSection == null)
            {
                throw new ArgumentNullException("pageTemplateSection");
            }

            this.PageTemplateSection = pageTemplateSection;
            this.PageSection = pageSectionOrNull;
        }
Exemplo n.º 2
0
        public PageSectionEditViewModel(PageTemplateSection pageTemplateSection, Page page, PageSection pageSection, int index, bool autoSubmit)
        {
            if (pageTemplateSection == null)
            {
                throw new ArgumentNullException("pageTemplateSection");
            }
            if (page == null)
            {
                throw new ArgumentNullException("page", "page must be specified and exist before editing page sections");
            }
            if (index < 1)
            {
                throw new ArgumentOutOfRangeException("index", "Index cannot be 0, it starts from 1 and up");
            }

            SetDefaults(pageTemplateSection);
            this.PageTemplateSectionId = pageTemplateSection.PageTemplateSectionId;
            this.SectionName = pageTemplateSection.Name;
            this.DefaultRawHtmlValue = pageTemplateSection.DefaultRawHtmlValue;
            this.PageId = page.PageId;
            this.Index = index;
            this.AutoSubmit = autoSubmit;

            if (pageSection != null)
            {
                this.PageSectionId = pageSection.PageSectionId;
                this.UseDefaultFromTemplate = pageSection.UseDefaultFromTemplate;
                this.HasNothing = pageSection.HasNothing;
                this.HasPlainText = pageSection.HasPlainText;
                this.HasRawHtml = pageSection.HasRawHtml;
                this.Order = pageSection.Order;
                this.PageId = pageSection.PageId;
                this.PlainText = pageSection.PlainText;
                this.RawHtml = pageSection.RawHtml;
                this.StartDateTimeUtc = pageSection.StartDateTimeUtc;
                this.EndDateTimeUtc = pageSection.EndDateTimeUtc;
                this.IsPending = pageSection.IsPending;
                this.UpdateDateTimeUtc = pageSection.UpdateDateTimeUtc;
                this.UpdatedBy = pageSection.UpdatedBy;
            }
        }