Exemplo n.º 1
0
        void SaveBookletData(string filename, StorageDevice storageDevice, Booklet booklet)
        {
            using (StorageContainer storageContainer = storageDevice.OpenContainer("Content"))
            {
                string filenamePath = Path.Combine(storageContainer.Path, filename);

                using (FileStream fileStream = File.Create(filenamePath))
                {
                    BinaryWriter myBw = new BinaryWriter(fileStream);
                    try
                    {
                        myBw.Write(booklet.ToByteArray());
                    }
                    catch (Exception e)
                    {
                        ;
                    }
                    finally
                    {
                        myBw.Flush();
                        myBw.Close();
                        fileStream.Close();
                        _operationPending = false;
                        storageContainer.Dispose();
                    }
                }
            }
        }
Exemplo n.º 2
0
        void SaveBookletData(string filename, StorageDevice storageDevice, Booklet booklet)
        {
            using (StorageContainer storageContainer = storageDevice.OpenContainer("Content"))
            {
                string filenamePath = Path.Combine(storageContainer.Path, filename);

                using (FileStream fileStream = File.Create(filenamePath))
                {
                    BinaryWriter myBw = new BinaryWriter(fileStream);
                    try
                    {
                        myBw.Write(booklet.ToByteArray());
                    }
                    catch (Exception e)
                    {
                        ;
                    }
                    finally
                    {
                        myBw.Flush();
                        myBw.Close();
                        fileStream.Close();
                        _operationPending = false;
                        storageContainer.Dispose();
                    }
                }
            }
        }