Ejemplo n.º 1
0
        public void Save(string fileName)
        {
            string oldName = FileName;

            FileName = fileName;

            using (FileStream fs = new FileStream(fileName + ".evo", FileMode.Create))
            {
                using (BinaryWriter w = new BinaryWriter(fs))
                {
                    this.Save(w);
                }
            }

            using (FileStream fs = new FileStream(fileName + ".evo.str", FileMode.Create))
            {
                using (BinaryWriter w = new BinaryWriter(fs))
                {
                    BinarySerializable.WriteSaveInfo(w);
                }
            }

            FileName = oldName;

            BinarySerializable.ClearSaveBuffer();
        }
Ejemplo n.º 2
0
        public static void Save(string fileName)
        {
            using (FileStream fs = new FileStream(fileName, FileMode.Create))
            {
                using (BinaryWriter w = new BinaryWriter(fs))
                {
                    SaveData(w);
                }
            }

            using (FileStream fs = new FileStream(fileName + ".str", FileMode.Create))
            {
                using (BinaryWriter w = new BinaryWriter(fs))
                {
                    BinarySerializable.WriteSaveInfo(w);
                }
            }

            BinarySerializable.ClearSaveBuffer();
        }