Ejemplo n.º 1
0
        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------

        #region Internal Methods

        /// <summary>
        ///    This converts from GUID for ITfCompartment to InputMethodStateType.
        /// </summary>
        internal static InputMethodStateType ToType(ref Guid rguid)
        {
            for (int i = 0; i < _iminfo.Length; i++)
            {
                InputMethodEventTypeInfo im = _iminfo[i];

                if (rguid == im._guid)
                {
                    return(im._inputmethodstatetype);
                }
            }

            Debug.Assert(false, "The guid does not match.");
            return(InputMethodStateType.Invalid);
        }
Ejemplo n.º 2
0
        internal TextServicesCompartment GetCompartment(InputMethodStateType statetype)
        {
            for (int i = 0; i < InputMethodEventTypeInfo.InfoList.Length; i++)
            {
                InputMethodEventTypeInfo iminfo = InputMethodEventTypeInfo.InfoList[i];

                if (iminfo.Type == statetype)
                {
                    if (iminfo.Scope == CompartmentScope.Thread)
                    {
                        return(GetThreadCompartment(iminfo.Guid));
                    }
                    else if (iminfo.Scope == CompartmentScope.Global)
                    {
                        return(GetGlobalCompartment(iminfo.Guid));
                    }
                }
            }
            return(null);
        }