Example #1
0
        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;
            }
            }
        }
Example #2
0
        private void SavePageHeaderFooter(PrintableComponentLink pcl, HeaderFooterStorage storage)
        {
            switch (storage)
            {
            case HeaderFooterStorage.Registry: {
                pcl.SavePageHeaderFooterToRegistry(registryPath);
                break;
            }

            case HeaderFooterStorage.XML: {
                pcl.SavePageHeaderFooterToXml(xmlFile);
                break;
            }

            case HeaderFooterStorage.Stream: {
                pcl.SavePageHeaderFooterToStream(stream);
                stream.Seek(0, SeekOrigin.Begin);
                break;
            }
            }
        }
Example #3
0
        private HeaderFooterStorage GetStorage()
        {
            HeaderFooterStorage storage = HeaderFooterStorage.Registry;

            switch (radioGroup1.SelectedIndex)
            {
            case 0: {
                storage = HeaderFooterStorage.Registry;
                break;
            }

            case 1: {
                storage = HeaderFooterStorage.XML;
                break;
            }

            case 2: {
                storage = HeaderFooterStorage.Stream;
                break;
            }
            }

            return(storage);
        }