Exemplo n.º 1
0
 public LanguageChangedListener(RichTextAreaHandler handler, swi.InputLanguageManager manager)
 {
     _handler = new WeakReference(handler);
     _manager = manager;
     _manager.InputLanguageChanged += LanguageChanged;
     handler.Control.Language       = CurrentLanguage;
 }
Exemplo n.º 2
0
 void Dispose(bool disposing)
 {
     if (_manager != null && !_manager.Dispatcher.HasShutdownStarted)
     {
         // when shutting down, this causes a com exception
         _manager.InputLanguageChanged -= LanguageChanged;
         _manager = null;
     }
 }
        //------------------------------------------------------
        //
        //  Constructors
        //
        //------------------------------------------------------
 
        /// <summary>
        ///    This is an internal. The source for input languages.
        /// </summary>
        internal InputLanguageSource(InputLanguageManager inputlanguagemanager)
        {
            _inputlanguagemanager = inputlanguagemanager;

            // initialize the current input language.
            _langid = (short)NativeMethods.IntPtrToInt32(SafeNativeMethods.GetKeyboardLayout(0));

            // store the dispatcher thread id. This will be used to call GetKeyboardLayout() from
            // other thread.
            _dispatcherThreadId = SafeNativeMethods.GetCurrentThreadId();

            // Register source
            _inputlanguagemanager.RegisterInputLanguageSource(this);
        }
Exemplo n.º 4
0
        //------------------------------------------------------
        //
        //  Constructors
        //
        //------------------------------------------------------

        /// <summary>
        ///    This is an internal. The source for input languages.
        /// </summary>
        internal InputLanguageSource(InputLanguageManager inputlanguagemanager)
        {
            _inputlanguagemanager = inputlanguagemanager;

            // initialize the current input language.
            _langid = (short)NativeMethods.IntPtrToInt32(SafeNativeMethods.GetKeyboardLayout(0));

            // store the dispatcher thread id. This will be used to call GetKeyboardLayout() from
            // other thread.
            _dispatcherThreadId = SafeNativeMethods.GetCurrentThreadId();

            // Register source
            _inputlanguagemanager.RegisterInputLanguageSource(this);
        }