コード例 #1
0
        private WinKeyboardDescription(TfInputProcessorProfile profile, ushort langId, IntPtr hkl, IKeyboardAdaptor engine)
            : base(engine, KeyboardType.System)
        {
            var winEngine = engine as WinKeyboardAdaptor;

            Debug.Assert(winEngine != null);

            InputProcessorProfile = profile;

            var    culture = new CultureInfo(langId);
            string locale;
            string cultureName;

            try
            {
                cultureName = culture.DisplayName;
                locale      = culture.Name;
            }
            catch (CultureNotFoundException)
            {
                // we get an exception for non-supported cultures, probably because of a
                // badly applied .NET patch.
                // http://www.ironspeed.com/Designer/3.2.4/WebHelp/Part_VI/Culture_ID__XXX__is_not_a_supported_culture.htm and others
                cultureName = "[Unknown Language]";
                locale      = "en-US";
            }
            WinKeyboardAdaptor.LayoutName layoutName;
            if (profile.Hkl == IntPtr.Zero && profile.ProfileType != TfProfileType.Illegal)
            {
                layoutName = new WinKeyboardAdaptor.LayoutName(winEngine.ProcessorProfiles.GetLanguageProfileDescription(
                                                                   ref profile.ClsId, profile.LangId, ref profile.GuidProfile));
            }
            else
            {
                layoutName = WinKeyboardAdaptor.GetLayoutNameEx(hkl);
            }

            Initialize(cultureName, layoutName, locale,
                       new InputLanguageWrapper(culture, hkl, layoutName.Name));
        }
コード例 #2
0
 private void Initialize(string displayName, WinKeyboardAdaptor.LayoutName layoutName, string locale, IInputLanguage inputLanguage)
 {
     ConversionMode = (int)(Win32.IME_CMODE.NATIVE | Win32.IME_CMODE.SYMBOL);
     InternalName = GetDisplayName(displayName, layoutName.Name);
     InternalLocalizedName = GetDisplayName(displayName, layoutName.LocalizedName);
     Layout = layoutName.Name;
     Locale = locale;
     SetInputLanguage(inputLanguage);
 }
コード例 #3
0
			public TfLanguageProfileNotifySink(WinKeyboardAdaptor keyboardAdaptor)
			{
				_keyboardAdaptor = keyboardAdaptor;
			}
コード例 #4
0
 public TfLanguageProfileNotifySink(WinKeyboardAdaptor keyboardAdaptor)
 {
     _keyboardAdaptor = keyboardAdaptor;
 }