public IMasterPage DuplicateMasterPage(Guid pageGuid) { CheckOpen(); if (!MasterPages.Contains(pageGuid)) { throw new ArgumentException("pageGuid"); } Serializer writer = new Serializer(_workingDirectoryGuid, Guid.Empty, _workingImagesDirectory); MasterPage sourcePage = MasterPages[pageGuid] as MasterPage; writer.AddMasterPage(sourcePage); IMasterPage newPage = null; using (Stream stream = writer.WriteToStream()) { IObjectContainer container = AddMasterPages(stream); if (container.MasterPageList.Count > 0) { newPage = container.MasterPageList[0]; } } newPage.IsLockedToMasterLocation = sourcePage.IsLockedToMasterLocation; return(newPage); }