public IOutputDescription Deserialize(string data)
{
IOutputDescription outputDescription = null;
if (!string.IsNullOrWhiteSpace(data))
{
data = data.Replace("<![CDATA[", "");
data = data.Replace("]]>", "");
var dataContractSerializer = new DataContractSerializer(typeof (IOutputDescription), _knownTypes);
using (var stringReader = new StringReader(StripKnownLegacyTags(data)))
{
using (var xmlTextReader = new XmlTextReader(stringReader))
{
try
{
outputDescription = dataContractSerializer.ReadObject(xmlTextReader) as IOutputDescription;
}
catch (Exception ex)
{
Dev2Logger.Log.Error(ex);
// we want to return null
}
}
}
}
return outputDescription;
}