private static string GetNeutralLanguageForAssembly(Assembly assembly)
{
foreach (CustomAttributeData cad in assembly.CustomAttributes)
{
if (cad.AttributeType.FullName.Equals("System.Resources.NeutralResourcesLanguageAttribute"))
{
foreach (CustomAttributeTypedArgument cata in cad.ConstructorArguments)
{
if (cata.ArgumentType.Equals(typeof(System.String)))
{
return (string) cata.Value;
}
}
}
}
// The assembly is not tagged with NeutralResourcesLanguageAttribute
return null;
}