Control with static constructor

It seems that if a control has a static constructor, Multi-Language Add-In adds the language change handler to the static constructor:

namespace MyControls {
public partial class MyControl : UserControl {

static MyControl() {
MLRuntime.MLRuntime.LanguageChanged += new MLRuntime.MLRuntime.LanguageChangedDelegate(ml_UpdateControls);
}

public MyControl() {
InitializeComponent();
}

...

This will cause compilation to fail because the event handler is not static.

Germany

That's obviously an error. I will try to fix it within the next few days.

Phil


Germany

Hi,

I have just uploaded a new version (4.54.0005) which should fix this problem. You can download it with the link
http://www.jollans.com/SetupMultiLang2005.exe

Note that the Add-In searches for the statement before inserting it. If it finds it anywhere in the module, then it will not insert it. This has two consequences:

  1. If you don't delete it in the static constructor, then the new version will not reinsert it
  2. If you simply move the statement from the static constructor to the non-static constructor, then the Add-In will not try to reinsert it in the static constructor. In this case, you don't really need the new version.

Phil

> Hi,
>
> I have just uploaded a new version (4.54.0005) which should fix this problem. You can download it with the link
> http://www.jollans.com/SetupMultiLang2005.exe
>

I fixed the instances manually for now. Thank you for the quick reply. The Multi-Language add-on is a life-saver utility, keep up the good work!