SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Christian Hornung

New Windows Forms Designer Localization Model Available

As of SharpDevelop 3.0 build 3273, support for a new localization model for the Windows.Forms designer is available.

The localization model can now be selected on a new options page:

The "property assignment" model has been the default in all earlier versions of SharpDevelop. When you look at the generated code for a localizable form, you can see it produces statements like this:

For many properties of each control on the form an assignment and a resource entry is generated. As stated in the .NET SDK documentation, this model scales very poorly as the number of properties increases, especially if a lot of properties are only set to their default values.

As of build 3273, SharpDevelop 3.0 now supports the "property reflection" model and also uses this one by default. It generates only a single line of code to apply the resource entries for each control:

The resources.ApplyResources method uses reflection to apply all resource entries in the resource file to the corresponding properties of the control. While reflection tends to be slower at runtime, this model has the advantage that default values are not written to the resource file and thus need not be applied at runtime. So generally this model is considered faster, especially for large numbers of controls and properties with default values. Additionally, the generated resource files (and thus also the resulting assemblies) are usually smaller compared to the "property assignment" model.

The new localization model options page also has a check box to selected whether the localization model of existing forms should be left unchanged. If this box is checked, when loading a form the designer will try to find out the existing localization model by analyzing the code and use that one. Otherwise, all forms will be converted to the selected localization model as soon as they are modified and saved.

Comments

No Comments
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.