Reputation: 2309
var asm = Assembly.GetEntryAssembly();
this.Image = Properties.Resources.ResourceManager
.GetString(logicalOptions.GetType().Name);
Is there a way to retrieve the ResourceManager
for an assembly which is dynamically discovered?
I would like to access the ResourceManager
of the asm
assembly.
Thanks
Upvotes: 0
Views: 51
Reputation: 28519
private ResourceManager GetResourceManager(Assembly assembly)
{
// Guess namespace name
var namespaceName = Path.GetFileNameWithoutExtension(assembly.CodeBase);
namespaceName = namespaceName + ".Properties.Resources";
return new ResourceManager(namespaceName, assembly);
}
Upvotes: 1