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.Reflecti on.Assembly myAssembly = this.GetType
().Assembly;
System.Reflecti on.Assembly myOtherAssembly ;
myOtherAssembly = System.Reflecti on.Assembly.Loa d
("SatelliteReso urce");
System.Resource s.ResourceManag er rm = new
System.Resource s.ResourceManag er
("SatelliteReso urce.resource", myOtherAssembly );
System.Globaliz ation.CultureIn fo thisCulture =
System.Threadin g.Thread.Curren tThread.Current Culture;
string retVal = rm.GetString
("System.NullRe ferenceExceptio n", 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.