Beispiel #1
0
        //------------------------------------------------------
        //
        //  Private Method
        //
        //------------------------------------------------------

        /// <summary>
        ///    This creates ITfInputProcessorProfile object and advice sink.
        /// </summary>
        private void EnsureInputProcessorProfile()
        {
            // _ipp has been initialzied. Don't do this again.
            if (_ipp != null)
            {
                return;
            }

            // We don't need to initialize _ipp if there is onlyone keyboard layout.
            // Only one input language is available.
            if (SafeNativeMethods.GetKeyboardLayoutList(0, null) <= 1)
            {
                return;
            }

            Debug.Assert(_ipp == null, "_EnsureInputProcesoorProfile has been called.");

            InputLanguageProfileNotifySink lpns;

            lpns = new InputLanguageProfileNotifySink(this);
            _ipp = new InputProcessorProfiles();

            if (!_ipp.Initialize(lpns))
            {
                _ipp = null;
            }
        }
        private void EnsureInputProcessorProfile()
        {
            // _ipp has been initialzied. Don't do this again.
            if (_ipp != null)
                return;

            // We don't need to initialize _ipp if there is onlyone keyboard layout.
            // Only one input language is available.
            if (SafeNativeMethods.GetKeyboardLayoutList(0, null) <= 1)
                return;

            Debug.Assert(_ipp == null, "_EnsureInputProcesoorProfile has been called.");

            InputLanguageProfileNotifySink lpns;
            lpns = new InputLanguageProfileNotifySink(this);
            _ipp= new InputProcessorProfiles();

            if (!_ipp.Initialize(lpns))
            {
                _ipp = null;
            }
        }