Esempio n. 1
0
        //================================================================================= Methods

        public override void Save(SavingMode mode)
        {
            bool isLocalTransaction = !TransactionScope.IsActive;

            if (isLocalTransaction)
            {
                //TransactionScope.Begin();
            }
            try
            {
                base.Save(mode);

                if (Binary != null)
                {
                    //this is very ugly: recreates pages that use this template
                    PageTemplateManager.GetBinaryData(this.Id, OriginalTemplateStream);
                }

                if (isLocalTransaction)
                {
                    //TransactionScope.Commit();
                }
            }
            finally
            {
                if (isLocalTransaction && TransactionScope.IsActive)
                {
                    //TransactionScope.Rollback();
                }
            }
        }
Esempio n. 2
0
        public static void GetBinaryData(int pageTemplateId, Stream oldStream)
        {
            PageTemplateManager pageTemplateManager = new PageTemplateManager();

            pageTemplateManager.PageTemplateNode = PageTemplate.LoadNode(pageTemplateId) as PageTemplate;
            pageTemplateManager.OriginalStream   = oldStream;
            pageTemplateManager.GenerateBinaryData();
        }
Esempio n. 3
0
        private void SetBinary()
        {
            var x = PersonalizationSettings;

            if (x != null)
            {
                x.GetStream();
            }

            if (this.PageTemplateNode != null)
            {
                this.Binary = PageTemplateManager.GetPageBinaryData(this, this.PageTemplateNode);
            }
        }
Esempio n. 4
0
        public static BinaryData GetPageBinaryData(Page page, PageTemplate pageTemplate)
        {
            PageTemplateManager pageTemplateManager = new PageTemplateManager();

            return(pageTemplateManager.GetASPXBinaryByPageTemplate(page, pageTemplate));
        }