M
Martin Platt
Guys!
I've been playing about with some code trying to get the
satellite assembly resource files to work.
From what I understand you must have a fallback for a
particular language, as well as specific regional
variations of that language in the satellite dll. That,
I can get to work.
The code I was using could load the currently executing
assembly, and pick out resources embedded in that without
any troubles.
Also, if I load a different satellite assembly, and use
the resourcemanager object on that, I can also make that
work. What I don't understand is, how is this useful? I
mean, if you must load the satellite assembly before
accessing the resource, it has to be hard coded in the
project (or you write something to trawl through a
particular location, loading all assemblies there?)
Here's a little snippet of what I'm trying to make use
of, but presently is of little use at all....
System.Reflection.Assembly myAssembly = this.GetType
().Assembly;
System.Reflection.Assembly myOtherAssembly;
myOtherAssembly = System.Reflection.Assembly.Load
("SatelliteResource");
System.Resources.ResourceManager rm = new
System.Resources.ResourceManager
("SatelliteResource.resource", myOtherAssembly);
System.Globalization.CultureInfo thisCulture =
System.Threading.Thread.CurrentThread.CurrentCulture;
string retVal = rm.GetString
("System.NullReferenceException", thisCulture);
MessageBox.Show(retVal);
I'd like this to be useful in that I can also have other
satellite resources, and add them into the application at
a later date without the need to recode.
Is trawling through and loading all dlls the smartest way
to do it??
Any suggestions would be highly appreciated...
Cheers.
I've been playing about with some code trying to get the
satellite assembly resource files to work.
From what I understand you must have a fallback for a
particular language, as well as specific regional
variations of that language in the satellite dll. That,
I can get to work.
The code I was using could load the currently executing
assembly, and pick out resources embedded in that without
any troubles.
Also, if I load a different satellite assembly, and use
the resourcemanager object on that, I can also make that
work. What I don't understand is, how is this useful? I
mean, if you must load the satellite assembly before
accessing the resource, it has to be hard coded in the
project (or you write something to trawl through a
particular location, loading all assemblies there?)
Here's a little snippet of what I'm trying to make use
of, but presently is of little use at all....
System.Reflection.Assembly myAssembly = this.GetType
().Assembly;
System.Reflection.Assembly myOtherAssembly;
myOtherAssembly = System.Reflection.Assembly.Load
("SatelliteResource");
System.Resources.ResourceManager rm = new
System.Resources.ResourceManager
("SatelliteResource.resource", myOtherAssembly);
System.Globalization.CultureInfo thisCulture =
System.Threading.Thread.CurrentThread.CurrentCulture;
string retVal = rm.GetString
("System.NullReferenceException", thisCulture);
MessageBox.Show(retVal);
I'd like this to be useful in that I can also have other
satellite resources, and add them into the application at
a later date without the need to recode.
Is trawling through and loading all dlls the smartest way
to do it??
Any suggestions would be highly appreciated...
Cheers.