public static void Deserialize(Stream stream, out ObjectiveList list) { try { BinaryFormatter formatter = new BinaryFormatter(); list = formatter.Deserialize(stream) as ObjectiveList; } catch (SerializationException e) { Trace.TraceError("Failed to deserialize. Reason: " + e.Message); list = null; throw; } }
public static void Serialize(Stream stream, ObjectiveList list) { try { BinaryFormatter formatter = new BinaryFormatter(); if (list != null) { formatter.Serialize(stream, list); } } catch (SerializationException e) { Trace.TraceError("Failed to serialize. Reason: " + e.Message); throw; } }