public static void GetBinaryData(int pageTemplateId, Stream oldStream) { PageTemplateManager pageTemplateManager = new PageTemplateManager(); pageTemplateManager.PageTemplateNode = PageTemplate.LoadNode(pageTemplateId) as PageTemplate; pageTemplateManager.OriginalStream = oldStream; pageTemplateManager.GenerateBinaryData(); }
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(); } } }
// ================================================================================= Methods public override void Save(SavingMode mode) { base.Save(mode); if (Binary != null) { // this is very ugly: recreates pages that use this template PageTemplateManager.GetBinaryData(this.Id, OriginalTemplateStream); } }
private void SetBinary() { var x = PersonalizationSettings; if (x != null) { x.GetStream(); } if (this.PageTemplateNode != null) { this.Binary = PageTemplateManager.GetPageBinaryData(this, this.PageTemplateNode); } }
public static BinaryData GetPageBinaryData(Page page, PageTemplate pageTemplate) { PageTemplateManager pageTemplateManager = new PageTemplateManager(); return(pageTemplateManager.GetASPXBinaryByPageTemplate(page, pageTemplate)); }
public static BinaryData GetPageBinaryData(Page page, PageTemplate pageTemplate) { PageTemplateManager pageTemplateManager = new PageTemplateManager(); return pageTemplateManager.GetASPXBinaryByPageTemplate(page, pageTemplate); }