private void RestorePageHeaderFooter(PrintableComponentLink pcl, HeaderFooterStorage storage) { pcl.PageHeaderFooter = new PageHeaderFooter(); switch (storage) { case HeaderFooterStorage.Registry: { pcl.RestorePageHeaderFooterFromRegistry(registryPath); break; } case HeaderFooterStorage.XML: { if (File.Exists(xmlFile)) { pcl.RestorePageHeaderFooterFromXml(xmlFile); } break; } case HeaderFooterStorage.Stream: { pcl.RestorePageHeaderFooterFromStream(stream); stream.Seek(0, SeekOrigin.Begin); break; } } }