public void Serialize(FlowDocument document, string fileName)
        {
            var xml = new XmlDocument();
            var root = xml.CreateElement("Document");
            xml.AppendChild(root);

            var factory = new SerializeBlockStrategyFactory();
            imageNames.Clear();
            foreach (var block in document.Blocks)
            {
                if (block is ImageBlock)
                {
                    imageNames.Add(new Uri(((ImageBlock) block).Source.ToString()).LocalPath);
                }
                root.AppendChild(factory.GetStrategy(block).Serialize(block, xml));
            }
            Save(xml, fileName);
        }
        public void Serialize(FlowDocument document, string fileName)
        {
            var xml  = new XmlDocument();
            var root = xml.CreateElement("Document");

            xml.AppendChild(root);

            var factory = new SerializeBlockStrategyFactory();

            imageNames.Clear();
            foreach (var block in document.Blocks)
            {
                if (block is ImageBlock)
                {
                    imageNames.Add(new Uri(((ImageBlock)block).Source.ToString()).LocalPath);
                }
                root.AppendChild(factory.GetStrategy(block).Serialize(block, xml));
            }
            Save(xml, fileName);
        }