Changeset 1315
- Timestamp:
- 03/09/09 15:15:31 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New Persistence Exploration/Persistence/Persistence/PrimitiveSerializers.cs
r1312 r1315 45 45 } 46 46 } 47 public class Boolean2XmlSerializer : IPrimitiveSerializer { 48 public Type Type { get { return typeof(bool); } } 49 public object Serialize(object o) { 50 return ((bool)o).ToString(); 51 } 52 public object DeSerialize(object o) { 53 return bool.Parse((string)o); 54 } 55 } 56 public class DateTime2XmlSerializer : IPrimitiveSerializer { 57 public Type Type { get { return typeof(DateTime); } } 58 public object Serialize(object o) { 59 return ((DateTime)o).Ticks.ToString(); 60 } 61 public object DeSerialize(object o) { 62 return new DateTime(long.Parse((string)o)); 63 } 64 } 47 65 }
Note: See TracChangeset
for help on using the changeset viewer.