private void SetMSDataAttribute(XmlElement root, Type type)
{
string result = DataStorage.GetQualifiedName(type);
try
{
if (null != _targetConverter)
{
result = _targetConverter(type);
}
if (!string.IsNullOrEmpty(result))
{
// SetAttribute doesn't fail with invalid data, but the final XmlDocument.Save will fail later
// with the ArugmentException when calling the actual XmlWriter.SetAttribute
root.SetAttribute(Keywords.MSD_DATATYPE, Keywords.MSDNS, result);
}
}
catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
{
ExceptionBuilder.ThrowMultipleTargetConverter(ex);
}
if (string.IsNullOrEmpty(result))
{
ExceptionBuilder.ThrowMultipleTargetConverter(null);
}
}
}