VSDesigner and Satelite Assemblies -
10-27-2004
, 07:42 AM
All,
I'm working with the satelite assemblies for quite some time now but I never
have found the solution for getting it working in the Windows Designer.
What I've got is the following:
Foreach assembly in my project there's one "namespace" folder called
StringResources. In there i'm supporting 4 languages of string resouces
resp. English (Default), Dutch, Russian and Spanish.
In the forms and user controls there's a method with the Designer generated
code. Overthere i've added the following code lines:
To initiate the resource manager:
System.Resources.ResourceManager assemblyResources = new
System.Resources.ResourceManager("JewelSuite.Strin gResources.strings",
this.GetType().Assembly);
To retrieve the string resources:
this.copyrightsLabel.Text =
assemblyResources.GetString("joaJewelSuiteAbout.Ti tleLabel");
The moment you open the Windows Designer it throws this error:
The variable 'assemblyResources' is either undeclared or was never assigned.
When I startup the application everything seems to work fine.
To solve this problem I've used the following strategies:
- Changed the initialization of the ResourceManager to
System.Resources.ResourceManager("JewelSuite.Strin gResources.strings",
typeof(joaJewelSuiteAbout)) to make sure the designer does not need a live
instance of the about dialog.
- Used a second VS environment to attach the the first VS environment to
check which assemblies where loaded by the designer. Nothing worthwile was
noticed.
- Made a derived class of the ResourceManager where I checked for a
running instance of the application and otherwise I returned the argument
(Resource name) passed in.
- I've encapsulate the ResourceManager in a Component and added some
attributes to check if the designers throwed some strange exceptions.
(Nothing found)
Anyone any other ideas how to get the designer support the multiple
languages? |