Dave
Fri Aug 18 09:07:32 CDT 2006
Hi Stefan,
> I'm aware of this possibility.
> But this doesn't make sense to me. If i use the resource manager
> directly i',m also
> able to use the string-source ( e.g. database table) directly. (ok
> there is some
> chance to replace it in the future but if this isn't the case it
> doesn't matter).
ResourceManager handles the management of data based on the current UI culture. That is the benefit of using the ResourceManager.
Sure, you can add this functionality directly to your data layer without the help of the ResourceManager but the code would end up
doing exactly what the ResourceManager does for you now.
> i (simply) like to have the string table (for a component-resource)
> stored into the database ( including designer-support).
> when the developer changes the localizable property and enter some
> strings, these strings should be added to the database instead of the
> *.resx file.
[...]
> But i have seen that there are a lot of interfaces like
> IResourceService, maybe
> i can get this Task done via a work-around ?
IResourceService on MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemcomponentmodeldesigniresourceserviceclasstopic.asp
I looked up IResourceService on MSDN, which provides an example. As I expected, it requires the use of a custom designer but I
still don't think it can accomplish what you want.
1. I don't think it makes use of a Form's Localizable and Language properties at design-time but instead uses designer verbs
2. I'm not sure if it's even possible to customize the default functionality of the Localizable and Language properties anyway.
3. I'm not sure if this solution will work across an entire Form since you can't apply your custom designer to every control on the
Form, if that's what you'd have to do.
4. I don't think it's worth the effort. As you can see from my previous post it's really easy to just use the ResourceManager from
code.
Another option however, if you aren't willing to just code against the ResourceManager, would be to create a custom
Component-derived class that exposes data-binding functionality and aggregates the custom ResourceManager class. Then, you can drop
the Component on your Form and bind controls' properties to the resource strings of your choice. Again, not sure if it's worth the
effort.
--
Dave Sexton