Serialize/Deserialize POCO’s

Short and easy way to to generically Serialize/Deserialize objects.

  1. public static string SerializeToXml<T>(T value)
  2. {
  3.     StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);
  4.     XmlSerializer serializer = new XmlSerializer(typeof(T));
  5.     serializer.Serialize(writer, value);
  6.     return writer.ToString();
  7. }
  8.  
  9. public static T DeserializeFromXml<T>(string xml)
  10. {
  11.     StringReader reader = new StringReader(xml);
  12.     XmlSerializer serializer = new XmlSerializer(typeof(T));
  13.     return (T)serializer.Deserialize(reader);
  14. }


Usage:

  1. MyObject myObj = new MyObject();
  2. string xmlAsString = SerializeToXml(myObj);
  3. MyObject newMyObj = DeserializeFromXml<MyObject>(xmlAsString);

BGE2-L50 L-Plate and BG-E2N Battery Grip Need New Home

When I bought my Canon 7D, my bride took over my 50D.  She doesn't like using the camera w/ the battery grip, so I now have a Really Right Stuff BGE2-L50 L-Plate and Canon BG-E2N Battery Grip that need a new home.  

I am asking $100 (includes shipping) each, if you are interested in buying either one or both of these items, send an email to jamie dot wallingford at gmail dot com and I'll reply back with a PayPal request for payment which you can pay by credit card.