private static string GetCompatibleAssemblyName(string shortName)
{
AssemblyName asmName = null;
for (int i = 0; i < _wellKnownAssemblies.Length; i++)
{
if (_wellKnownAssemblies[i] != null)
{
// create an assembly name with the same version and token info
// as the WPF assembilies
asmName = _wellKnownAssemblies[i].GetName();
asmName.Name = shortName;
break;
}
}
if (asmName == null)
{
// there is no WPF assembly loaded yet. We will just get the compatible version
// of the current PresentationFramework
Assembly presentationFramework = typeof(BamlLocalizer).Assembly;
asmName = presentationFramework.GetName();
asmName.Name = shortName;
}
return asmName.ToString();
}