コード例 #1
0
 private void OnLanguageChanged(object o)
 {
     var language = (Language) o;
     _selectedSwitcheroo = null;
     ChangeKeyboard(language.ISO2Code);
     if (_langPopup.IsOpen)
         _langPopup.IsOpen = false;
 }
コード例 #2
0
        private string HandleSwitcherooKey(VKey key)
        {
            string switcherooCode = key.SwitcherooCode;
            //switch the layout ...
            switcherooCode = key.IsPressed ? switcherooCode : SelectedKeyboard.DefaultSwitcheroo;
            //unlock the key if it is locked
            SetLockStatus(key,false);
            if (_selectedSwitcheroo == null || _selectedSwitcheroo.Name != switcherooCode)
            {
                Switcheroo switcheroo = SelectedKeyboard.Switcheroos.First(s => s.Name == switcherooCode);
                //we switched the layout so reset the page index
                _currentPageIndex = 0;
                //enable the keys with page action next, and disable the previous
                List<VKey> pageKeys =
                    switcheroo.KeyCollection.FindAll(vkey => null != vkey.PageAction);
                foreach (VKey item in pageKeys)
                {
                    item.IsEnabled = item.PageAction == "next";
                }
                _selectedSwitcheroo = switcheroo;
            }

            //update the modifier key status
            return switcherooCode;
        }