Last post Nov 13, 2009 04:33 AM by Gonki
May 14, 2008 09:03 PM|clement_911|LINK
Is is possible to access to local resources in a strongly typed, in a similar fashion as the strongly typed access to Global resources.
I think I read someday that it could not be done because local resources name can contain dots. But couldn't the wrapper
class 'escape' or 'replace' thoses dots with underscores ??
Local resource strong type
Jun 04, 2008 07:37 PM|AndrewSeven|LINK
If you look at the properties of global resources you can see that it has a custom tool :GlobalResourceProxyGenerator
You can set the custom tool of a local resource and it will generate the designer.
Its a start, I'm not sure how well it will work but you will be able to do this:
Jun 04, 2008 08:00 PM|clement_911|LINK
Thanks Andrew, it worked instantly !
Interestingly enough the dots are indeed replaced by underscores.
However the custom tool I used is not called GlobalResourceProxyGenerator but ResXFileCodeGenerator
Nov 13, 2009 04:33 AM|Gonki|LINK
Worked like a charm :-)
But as you are mentioning clement 911, there are two possible values for "Custom Tool"
GlobalResourceProxyGenerator: is best used for Global resource files, and will add the file to the namespace Resources. When I tried to alter this namespace, VS2008 changed it back to "Resources" as soon as the file was resaved.
ResXFileCodeGenerator: can be uses for a resource file anywhere in the application, and let you choose the namespace you want for the file.