internal static string GetAssemblyQualifiedName(Type type, Func<Type, string> converter)
{
string assemblyFullName = null;
if (type != null)
{
if (converter != null)
{
try
{
assemblyFullName = converter(type);
// TODO: validate that type and assembly names are well constructed - throw if not.
}
catch (Exception e)
{
if (IsSecurityOrCriticalException(e))
{
throw;
}
}
}
if (assemblyFullName == null)
{
assemblyFullName = type.AssemblyQualifiedName;
}
}
return assemblyFullName;
}