private bool TryGetSerializedCommands() { try { var stream = File.Open(_commandsPath, FileMode.Open); var bFormatter = new CustomFormatter(); _commands = bFormatter.Deserialize(stream); stream.Close(); } catch (Exception) { return(false); } return(true); }
private bool TryGetSerializedCommands() { try { var stream = File.Open(_commandsPath, FileMode.Open); var bFormatter = new CustomFormatter(); _commands = bFormatter.Deserialize(stream); stream.Close(); } catch (Exception) { return false; } return true; }
private void SerializeCommands() { var stream = File.Open(_commandsPath, FileMode.Create); var bFormatter = new CustomFormatter(); bFormatter.Serialize(stream, _commands); stream.Close(); }