示例#1
0
 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;
     }
 }
示例#2
0
 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;
     }
 }