/// <summary> /// Called by Move It - decodes custom data records. /// Not specifically used by ABLC. /// </summary> /// <param name="record">String to decode</param> /// <param name="dataVersion">Data version</param> /// <returns>Decoded record</returns> public override object Decode64(string record, Version dataVersion) { // Safety check. if (record == null || record.Length == 0) { return(null); } // Generic xml encoding. XElement xml; using (StringReader input = new StringReader((string)EncodeUtil.BinaryDecode64(record))) { XmlReaderSettings xmlReaderSettings = new XmlReaderSettings { IgnoreWhitespace = true, ProhibitDtd = false, XmlResolver = null }; using (XmlReader reader = XmlReader.Create(input, xmlReaderSettings)) { xml = XElement.Load(reader, LoadOptions.None); } } return(xml); }
public override object Decode64(string record, Version dataVersion) { if (record == null || record.Length == 0) { return(null); } // XElement.Parse throws MissingMethodException // Method not found: System.Xml.XmlReaderSettings.set_MaxCharactersFromEntities XElement xml; using (StringReader input = new StringReader((string)EncodeUtil.BinaryDecode64(record))) { XmlReaderSettings xmlReaderSettings = new XmlReaderSettings { IgnoreWhitespace = true, ProhibitDtd = false, XmlResolver = null }; using (XmlReader reader = XmlReader.Create(input, xmlReaderSettings)) { xml = XElement.Load(reader, LoadOptions.None); } } return(xml); }
public override object Decode64(string record, Version dataVersion) { if (record == null || record.Length == 0) { return(null); } using StringReader input = new StringReader((string)EncodeUtil.BinaryDecode64(record)); XmlReaderSettings xmlReaderSettings = new XmlReaderSettings { IgnoreWhitespace = true, ProhibitDtd = false, XmlResolver = null }; using XmlReader reader = XmlReader.Create(input, xmlReaderSettings); return(XElement.Load(reader, LoadOptions.None)); }