public void WriteXml(string filename)
        {
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(FlipTemplateDb));
                TextWriter    writer     = new StreamWriter(filename);

                FlipTile tile = new FlipTile();
                tile.BackBackgroundImage = "BackBackgroundImage";
                tile.BackContent         = "BackContent";
                tile.BackgroundImage     = "BackgroundImage";
                tile.BackTitle           = "BackTitle";
                tile.Count = 10;
                tile.SmallBackgroundImage    = "SmallBackgroundImage";
                tile.WideBackBackgroundImage = "WideBackBackgroundImage";
                tile.WideBackContent         = "WideBackContent";
                tile.WideBackgroundImage     = "WideBackgroundImage";

                FlipTemplateDb mDb       = new FlipTemplateDb();
                FlipTile[]     flipTiles = { tile, tile };
                mDb.Tiles = flipTiles;

                // Serializes the purchase order, and closes the TextWriter.
                serializer.Serialize(writer, mDb);
                writer.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public void LoadXml(string filename)
        {
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(FlipTemplateDb));

                // A FileStream is needed to read the XML document.
                FileStream fs = new FileStream(filename, FileMode.Open);

                // Uses the Deserialize method to restore the object's state
                // with data from the XML document.
                tilesDb = (FlipTemplateDb)serializer.Deserialize(fs);

                int count = tilesDb.Tiles.Count();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public void LoadXml(string filename)
        {
            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(FlipTemplateDb));

                // A FileStream is needed to read the XML document.
                FileStream fs = new FileStream(filename, FileMode.Open);

                // Uses the Deserialize method to restore the object's state 
                // with data from the XML document.
                tilesDb = (FlipTemplateDb)serializer.Deserialize(fs);

                int count = tilesDb.Tiles.Count();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

        }
        public void WriteXml(string filename)
        {

            try
            {
                XmlSerializer serializer = new XmlSerializer(typeof(FlipTemplateDb));
                TextWriter writer = new StreamWriter(filename);

                FlipTile tile = new FlipTile();
                tile.BackBackgroundImage = "BackBackgroundImage";
                tile.BackContent = "BackContent";
                tile.BackgroundImage = "BackgroundImage";
                tile.BackTitle = "BackTitle";
                tile.Count = 10;
                tile.SmallBackgroundImage = "SmallBackgroundImage";
                tile.WideBackBackgroundImage = "WideBackBackgroundImage";
                tile.WideBackContent = "WideBackContent";
                tile.WideBackgroundImage = "WideBackgroundImage";

                FlipTemplateDb mDb = new FlipTemplateDb();
                FlipTile[] flipTiles = { tile, tile };
                mDb.Tiles = flipTiles;

                // Serializes the purchase order, and closes the TextWriter.
                serializer.Serialize(writer, mDb);
                writer.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

        }