public void LoeadFromFile(ref Central central, String f) { using (Stream stream = File.Open(f, FileMode.Open)) { var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); central = (Central)binaryFormatter.Deserialize(stream); } }
public void SaveToFile(String f, Central central) { using (Stream stream = File.Open(f, FileMode.Create)) { var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); binaryFormatter.Serialize(stream, central); } }