Strongly typed resource strings in CF2

  • Thread starter Thread starter polly.dixon
  • Start date Start date
P

polly.dixon

Hi,

I can't seem to find any information on using the My.Resources object
in C# under CF2 in order to access localized resource strings. I know
it is no longer required to use the ResourceManager directly.

I was playing around with this functionality a while ago but can't
remember how I did it.

Any pointers would be great. All examples on MSDN seem to be VB which
works ok!?
 
Simply create a resource file in your project (.resx).
In the propery grid of the resource file, ensure the Custom tool is set to
"ResXFileCodeGenerator".
When you edit the resx file, a class will be generated (if the file is
myres.resx, the class will be myres).

If you want to support multiple langages, simply add beside the resx fil a
"culture".resx where culture is the name of the culture.
For example, create the following files :

myres.resx <-- neutral culture
myres.fr.resx <-- french culture
myres.de.resx <-- german culture

Note that the "ResXFileCodeGenerator" custom tool is only need to be set on
the neutral culture.

Hope that helps

Steve
 
Back
Top