Exemplo n.º 1
0
        public void Save(Field field)
        {
            FileStream fs = new FileStream(Path.Combine(Environment.CurrentDirectory, file), FileMode.Create, FileAccess.Write);

            BinaryFormatter formatter = new BinaryFormatter();

            try
            {
                formatter.Serialize(fs, field);
            }
            catch (SerializationException e)
            {
                facade.Exception(Texts.SerializationException, e.Message);
                throw;
            }
            finally
            {
                fs.Close();
            }
        }