public void Save(Game.GameOptions options) { using (FileStream fs = new FileStream(_filePath, FileMode.OpenOrCreate)) { new BinaryFormatter().Serialize(fs, options); } }
public Game.GameOptions Load() { Game.GameOptions options = null; if (File.Exists(_filePath)) { using (FileStream file = File.Open(_filePath, FileMode.Open)) { object loadedData = new BinaryFormatter().Deserialize(file); options = (Game.GameOptions)loadedData; } } return(options); }