Esempio n. 1
0
        /// <summary>
        ///     Report the input language is changed from the source.
        /// </summary>
        /// <param name="newLanguageId">
        ///     The new language id.
        /// </param>
        /// <param name="previousLanguageId">
        ///     The previous language id.
        /// </param>
        public void ReportInputLanguageChanged(
            CultureInfo newLanguageId,
            CultureInfo previousLanguageId)
        {
            if (newLanguageId == null)
            {
                throw new ArgumentNullException("newLanguageId");
            }

            if (previousLanguageId == null)
            {
                throw new ArgumentNullException("previousLanguageId");
            }

            //
            // if this language change was not done by SetFocus() and
            // InputLanguage Property of the element, we clear _previousLanguageId.
            //
            if (!previousLanguageId.Equals(_previousLanguageId))
            {
                _previousLanguageId = null;
            }

            if (_InputLanguageChanged != null)
            {
                InputLanguageChangedEventArgs args = new InputLanguageChangedEventArgs(newLanguageId, previousLanguageId);

                // Stability Review: Task#32416
                //   - No state to be restored even exception happens while this callback.
                _InputLanguageChanged(this, args);
            }
        }
Esempio n. 2
0
        /// <summary>
        ///     Report the input language is changed from the source.
        /// </summary> 
        /// <param name="newLanguageId">
        ///     The new language id. 
        /// </param> 
        /// <param name="previousLanguageId">
        ///     The previous language id. 
        /// </param>
        public void ReportInputLanguageChanged(
                        CultureInfo newLanguageId,
                        CultureInfo previousLanguageId) 
        {
            if (newLanguageId == null) 
            { 
                throw new ArgumentNullException("newLanguageId");
            } 

            if (previousLanguageId == null)
            {
                throw new ArgumentNullException("previousLanguageId"); 
            }
 
            // 
            // if this language change was not done by SetFocus() and
            // InputLanguage Property of the element, we clear _previousLanguageId. 
            //
            if (!previousLanguageId.Equals(_previousLanguageId))
            {
                _previousLanguageId = null; 
            }
 
            if (_InputLanguageChanged != null) 
            {
                InputLanguageChangedEventArgs args = new InputLanguageChangedEventArgs(newLanguageId, previousLanguageId); 

                // Stability Review: Task#32416
                //   - No state to be restored even exception happens while this callback.
                _InputLanguageChanged(this, args); 
            }
        }