public static T Deserialize <T>(string rawXml) where T : IXmlSerializable, new() { Util.ThrowOnNullOrEmptyArgument(rawXml, "rawXml"); T t = (default(T) == null) ? Activator.CreateInstance <T>() : default(T); MigrationXmlSerializer.Deserialize(rawXml, new Action <XmlReader>(t.ReadXml)); return(t); }
public MultiValuedProperty <string> GetMultiValuedStringProperty(string key) { if (this.Contains(key)) { string required = this.GetRequired <string>(key); return((MultiValuedProperty <string>)MigrationXmlSerializer.Deserialize(required, typeof(MultiValuedProperty <string>))); } return(null); }
public static object Deserialize(string rawXml, Type type) { Util.ThrowOnNullOrEmptyArgument(rawXml, "rawXml"); Util.ThrowOnNullArgument(type, "type"); object obj = null; MigrationXmlSerializer.Deserialize(rawXml, delegate(XmlReader xmlReader) { XmlSerializer xmlSerializer = new XmlSerializer(type); obj = xmlSerializer.Deserialize(xmlReader); }); if (obj == null) { throw new MigrationDataCorruptionException("couldn't deserialize object of type " + type); } return(obj); }
public string Serialize() { return(MigrationXmlSerializer.Serialize(this)); }
public static PersistableDictionary Create(string rawXml) { return(MigrationXmlSerializer.Deserialize <PersistableDictionary>(rawXml)); }
public void SetMultiValuedProperty(string key, MultiValuedProperty <string> value) { this[key] = MigrationXmlSerializer.Serialize(value); }
public override string ToString() { return(MigrationXmlSerializer.Serialize(this)); }