public static Message DeserializeFromXml(Byte[] msg) { Message message = null; var mem = new MemoryStream(msg); var reader = XmlReader.Create(mem); using (var woxalizer = new WoxalizerUtil()) { // can throw exception message = (Message)woxalizer.Load(reader); } return(message); }
public static object LoadFromFile(string filename) { object ob = null; using (var woxalizer = new WoxalizerUtil()) { try { ob = woxalizer.Load(filename); } catch (Exception) { Logger.WriteStr("DEBUG: Unable to load object from " + filename + "!"); } } return(ob); }