Select to view content in your preferred language

Programming using ArcGIS Desktop .NET SDK

2285
4
06-14-2010 09:43 PM
MuzammilAK
Deactivated User
I am developing a toolbar which contains few commands, using ArcGIS Desktop .NET SDK. Now when i click a particular command, the properties of entire toolbar and its contents should be changed. That is, tooltip, caption, message, text, etc should be changed to another language. I have the language mapping in the database and when the toolbar loads, i am getting all the values from database.

This is working for first time i.e, when the toolbar loads, it is applying. But How to make it apply ad-hoc. That is when i click on particular command, the language of all the properties should change.

Please help.

Note: i have only 2 languages to be considered.

Regards
Muzammil
0 Kudos
4 Replies
AlexanderGray
Honored Contributor
I have tried this but I don't think there is any way to make this work.  I have ArcGIS desktop with a language supplement (french.)  The language of the process is set off of the culture (not UI culture) from the local set for the OS.  Once I start in french everything is in french and if I start in English, everything is in english.  I had to adjust my own code so that my commands follow the same pattern.

If you only want to make your custom commands change language, You might consider exposing the display member variables m_name, etc from the command class through a write property and find the command on the toolbar, cast it to your class (an abstact class derived from basecommand perhaps) and change it manually (from the database.) I have never tried this since it wourld not work on built in ArcGIS commands.
0 Kudos
MuzammilAK
Deactivated User
Thank you Alex.

i was thinking about the way you have suggested. But if we implemented BaseCommand, we need to override its properties like tooltip, message, etc. These properties are read-only in BaseCommand prototype declarations. Therefore, we can not put a set property for the same.

Please Let me know, if we are on the same page.

In VB6, it has get-set properties and i could change. But in .NET no luck yet.

Please let me know how to achieve this. It is not mandatory that it has to be built in commands. Please suggest some other way of doing things in .NET.

Thank you.

Regards
Muzammil
0 Kudos
AlexanderGray
Honored Contributor
The properties as part of the ICommand implementation are readonly.  The fields or member variables in the base class are read-write and protected.  That means you can change them in a derived class.  This is what you do in the constructor of the class when you use the ArcGIS wizard to create a command.  You could make your own custom properties (not part of the Icommand) and name them whatever you like and set the fields in the base class in those properties.  Not sure how ArcMap will react though.  Good luck!
0 Kudos
GeorgeSilva
Emerging Contributor
I'm not sure if ArcMap will reload these objects based on interaction.

I think they're setted while OnCreate event. I can be wrong, and I would like to know your results. Please share if our friend above idea works.
0 Kudos