public WinKeyboardAdaptor() { try { ProcessorProfiles = new TfInputProcessorProfilesClass(); } catch (InvalidCastException) { ProcessorProfiles = null; return; } // ProfileMgr will be null on Windows XP - the interface got introduced in Vista ProfileMgr = ProcessorProfiles as ITfInputProcessorProfileMgr; m_tfLanguageProfileNotifySink = new TfLanguageProfileNotifySink(this); TfSource = ProcessorProfiles as ITfSource; if (TfSource != null) { m_profileNotifySinkCookie = TfSource.AdviseSink(Guids.ITfLanguageProfileNotifySink, m_tfLanguageProfileNotifySink); } if (KeyboardController.EventProvider != null) { KeyboardController.EventProvider.ControlAdded += OnControlRegistered; KeyboardController.EventProvider.ControlRemoving += OnControlRemoving; } }
public WinKeyboardAdaptor() { try { ProcessorProfiles = new TfInputProcessorProfilesClass(); } catch (InvalidCastException) { ProcessorProfiles = null; return; } // ProfileMgr will be null on Windows XP - the interface got introduced in Vista ProfileMgr = ProcessorProfiles as ITfInputProcessorProfileMgr; _tfLanguageProfileNotifySink = new TfLanguageProfileNotifySink(this); TfSource = ProcessorProfiles as ITfSource; if (TfSource != null) { _profileNotifySinkCookie = TfSource.AdviseSink(Guids.ITfLanguageProfileNotifySink, _tfLanguageProfileNotifySink); } if (KeyboardController.Instance != null) { KeyboardController.Instance.ControlAdded += OnControlRegistered; KeyboardController.Instance.ControlRemoving += OnControlRemoving; } }