Example #1
0
 public object Deserialize(string data, System.Type type)
 {
     return(Serializer.DeserializeFromString(data, type));
 }
Example #2
0
 /// <summary>
 /// Deserializes stream into an object
 /// </summary>
 /// <typeparam name="T">Type of object to serialize to</typeparam>
 /// <param name="stream">Stream to deserialize from</param>
 /// <returns>Object of type T</returns>
 public T Deserialize <T>(Stream stream) where T : class
 {
     return(Serializer.DeserializeFromStream <T>(stream));
 }
Example #3
0
 /// <summary>
 /// Serializes object to a stream
 /// </summary>
 /// <param name="obj">Object to serialize</param>
 /// <param name="stream">Stream to serialize to</param>
 public void Serialize <T>(T obj, Stream stream)
 {
     Serializer.SerializeToStream(obj, stream);
 }
Example #4
0
 /// <summary>
 /// Deserializes string into an object
 /// </summary>
 /// <typeparam name="T">Type of object to serialize to</typeparam>
 /// <param name="data">Serialized object</param>
 /// <returns>Object of type T</returns>
 public T Deserialize <T>(string data)
 {
     return(Serializer.DeserializeFromString <T>(data));
 }
Example #5
0
 /// <summary>
 /// Serializes object to a string
 /// </summary>
 /// <param name="obj">Object to serialize</param>
 /// <returns>Serialized string of the object</returns>
 public string Serialize <T>(T obj)
 {
     return(Serializer.SerializeToString(obj));
 }