SIL.FieldWorks.FieldWorks.UglyHackForXkbIndicator C# (CSharp) Метод

UglyHackForXkbIndicator() приватный статический Метод

For some reason, setting an Xkb keyboard for the first time doesn't work well inside FieldWorks. The keyboard is actually set (although it may take effect only after the first one or two keystrokes), but the indicator on the system icon bar does not change. Setting several Xkb keyboards at this point seems to fix the problem for when the first one is set different than the default keyboard. This hack is not guaranteed to work, but it does seem to help in most scenarios. See FWNX-1299.
If you can think of a better solution, by all means replace this ugly hack! It took me a day of work to come up with even this much. I tried setting the multiple keyboards in succession inside Palaso.UI.WindowsForms.Keyboarding.Linux.XkbKeyboardAdaptor.ReinitLocales() but it didn't work doing it there for some reason.
private static UglyHackForXkbIndicator ( ) : void
Результат void
		private static void UglyHackForXkbIndicator()
		{
			foreach (var ws in s_cache.ServiceLocator.WritingSystems.AllWritingSystems)
				SetKeyboardForWs(ws.Handle);
			Palaso.WritingSystems.Keyboard.Controller.ActivateDefaultKeyboard();
		}
		private static void SetKeyboardForWs(int ws)
FieldWorks