InputMethod 类

定义

提供用于管理文本服务框架和与文本服务框架交互的功能。文本服务框架提供对备用文本输入法(例如语音和手写功能)的支持。Provides facilities for managing and interacting with the Text Services Framework, which provides support for alternate text input methods such as speech and handwriting.

public ref class InputMethod : System::Windows::Threading::DispatcherObject
public class InputMethod : System.Windows.Threading.DispatcherObject
type InputMethod = class
    inherit DispatcherObject
Public Class InputMethod
Inherits DispatcherObject
继承
InputMethod

示例

下面的示例演示如何使用InputMethod对象。The following example demonstrates how to use an InputMethod object.

InputMethod.SetPreferredImeState(myTextBox, InputMethodState.On);
InputMethod.Current.ImeSentenceMode = ImeSentenceModeValues.Automatic;
InputMethod.Current.HandwritingState = InputMethodState.On;
InputMethod.Current.SpeechMode = SpeechMode.Dictation;
InputScope myInputScope = new InputScope();
myInputScope.RegularExpression = "W|P|F";
InputMethod.SetInputScope(myTextBox, myInputScope);
tb6.Text = "Configuration UI Available?: " + InputMethod.Current.CanShowConfigurationUI.ToString();
InputMethod.SetPreferredImeState(myTextBox, InputMethodState.On)
InputMethod.Current.ImeSentenceMode = ImeSentenceModeValues.Automatic
InputMethod.Current.HandwritingState = InputMethodState.On
InputMethod.Current.SpeechMode = SpeechMode.Dictation
Dim myInputScope As New InputScope()
myInputScope.RegularExpression = "W|P|F"
InputMethod.SetInputScope(myTextBox, myInputScope)
tb6.Text = "Configuration UI Available?: " & InputMethod.Current.CanShowConfigurationUI.ToString()

字段

InputScopeProperty

标识 InputScope 附加属性。Identifies the InputScope attached property.

IsInputMethodEnabledProperty

标识 IsInputMethodEnabled 附加属性。Identifies the IsInputMethodEnabled attached property.

IsInputMethodSuspendedProperty

标识 IsInputMethodSuspended 附加属性。Identifies the IsInputMethodSuspended attached property.

PreferredImeConversionModeProperty

标识 PreferredImeConversionMode 附加属性。Identifies the PreferredImeConversionMode attached property.

PreferredImeSentenceModeProperty

标识 PreferredImeSentenceMode 附加属性。Identifies the PreferredImeSentenceMode attached property.

PreferredImeStateProperty

标识 PreferredImeState 附加属性。Identifies the PreferredImeState attached property.

属性

CanShowConfigurationUI

获取一个值,该值指示此输入法是否可以显示配置用户界面 (UI)user interface (UI)Gets a value that indicates whether or not this input method can display configuration 用户界面 (UI)user interface (UI).

CanShowRegisterWordUI

获取一个值,该值指示此输入法是否可以显示字词注册用户界面 (UI)user interface (UI)Gets a value that indicates whether this input method can display word registration 用户界面 (UI)user interface (UI).

Current

获取对与当前上下文关联的任何当前活动的输入法的引用。Gets a reference to any currently active input method associated with the current context.

Dispatcher

获取与此 Dispatcher 关联的 DispatcherObjectGets the Dispatcher this DispatcherObject is associated with.

(继承自 DispatcherObject)
HandwritingState

获取或设置此输入法的手写输入的当前状态。Gets or sets the current state of handwriting input for this input method.

ImeConversionMode

获取或设置与该输入法关联的输入法编辑器的当前转换模式。Gets or sets the current conversion mode for the input method editor associated with this input method.

ImeSentenceMode

获取或设置与该输入法关联的输入法编辑器的当前句子模式。Gets or sets the current sentence mode for the input method editor associated with this input method.

ImeState

获取或设置与该输入法关联的输入法编辑器的当前状态。Gets or sets the current state of the input method editor associated with this input method.

MicrophoneState

获取或设置此输入法的麦克风输入的当前状态。Gets or sets the current state of microphone input for this input method.

SpeechMode

获取或设置此输入法的语音模式。Gets or sets the speech mode for this input method.

附加属性

InputScope

获取或设置某个指定依赖项对象的输入范围。Gets or sets the input scope for a specified dependency object.

IsInputMethodEnabled

获取或设置一个值,该值指示是否启用了此输入法。Gets or sets a value that indicates whether this input method is enabled.

IsInputMethodSuspended

获取或设置一个值,该值指示是否挂起了此输入法。Gets or sets a value that indicates whether this input method is suspended.

PreferredImeConversionMode

获取或设置某个指定依赖项对象的首选 ImeConversionModeValues 值。Gets or sets a preferred ImeConversionModeValues value for a specified dependency object.

PreferredImeSentenceMode

获取或设置某个指定依赖项对象的首选 ImeSentenceModeValues 值。Gets or sets a preferred ImeSentenceModeValues value for a specified dependency object.

PreferredImeState

获取或设置某个指定依赖项对象的首选输入法状态。Gets or sets a preferred input method state for a specified dependency object.

方法

CheckAccess()

确定调用线程是否可以访问此 DispatcherObjectDetermines whether the calling thread has access to this DispatcherObject.

(继承自 DispatcherObject)
Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetInputScope(DependencyObject)

返回指定的依赖对象的 InputScope 附加属性值。Returns the value of the InputScope attached property for a specified dependency object.

GetIsInputMethodEnabled(DependencyObject)

返回指定的依赖对象的 IsInputMethodEnabled 附加属性值。Returns the value of the IsInputMethodEnabled attached property for a specified dependency object.

GetIsInputMethodSuspended(DependencyObject)

返回指定的依赖对象的 IsInputMethodSuspended 附加属性值。Returns the value of the IsInputMethodSuspended attached property for a specified dependency object.

GetPreferredImeConversionMode(DependencyObject)

返回指定的依赖对象的 PreferredImeConversionMode 附加属性值。Returns the value of the PreferredImeConversionMode attached property for a specified dependency object.

GetPreferredImeSentenceMode(DependencyObject)

返回指定的依赖对象的 PreferredImeSentenceMode 附加属性值。Returns the value of the PreferredImeSentenceMode attached property for a specified dependency object.

GetPreferredImeState(DependencyObject)

返回指定的依赖对象的 PreferredImeState 附加属性值。Returns the value of the PreferredImeState attached property for a specified dependency object.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
SetInputScope(DependencyObject, InputScope)

设置指定依赖对象上的 InputScope 附加属性的值。Sets the value of the InputScope attached property on the specified dependency object.

SetIsInputMethodEnabled(DependencyObject, Boolean)

设置指定依赖对象上的 IsInputMethodEnabled 附加属性的值。Sets the value of the IsInputMethodEnabled attached property on the specified dependency object.

SetIsInputMethodSuspended(DependencyObject, Boolean)

设置指定依赖对象上的 IsInputMethodSuspended 附加属性的值。Sets the value of the IsInputMethodSuspended attached property on the specified dependency object.

SetPreferredImeConversionMode(DependencyObject, ImeConversionModeValues)

设置指定依赖对象上的 PreferredImeConversionMode 附加属性的值。Sets the value of the PreferredImeConversionMode attached property on the specified dependency object.

SetPreferredImeSentenceMode(DependencyObject, ImeSentenceModeValues)

设置指定依赖对象上的 PreferredImeSentenceMode 附加属性的值。Sets the value of the PreferredImeSentenceMode attached property on the specified dependency object.

SetPreferredImeState(DependencyObject, InputMethodState)

设置指定依赖对象上的 PreferredImeState 附加属性的值。Sets the value of the PreferredImeState attached property on the specified dependency object.

ShowConfigureUI()

显示与当前活动的键盘文本服务关联的配置用户界面 (UI)user interface (UI)Displays configuration 用户界面 (UI)user interface (UI) associated with the currently active keyboard text service.

ShowConfigureUI(UIElement)

显示与当前活动的键盘文本服务关联的配置用户界面 (UI)user interface (UI)(使用指定的 UIElement 作为配置 UIUI 的父元素)。Displays configuration 用户界面 (UI)user interface (UI) associated with the currently active keyboard text service, using a specified UIElement as the parent element for the configuration UIUI.

ShowRegisterWordUI()

显示与当前活动的键盘文本服务关联的字词注册用户界面 (UI)user interface (UI)Displays word registration 用户界面 (UI)user interface (UI) associated with the currently active keyboard text service.

ShowRegisterWordUI(String)

显示与当前活动的键盘文本服务关联的字词注册用户界面 (UI)user interface (UI)Displays word registration 用户界面 (UI)user interface (UI) associated with the currently active keyboard text service. 接受一个指定字符串作为要注册的默认值。Accepts a specified string as the default value to register.

ShowRegisterWordUI(UIElement, String)

显示与当前活动的键盘文本服务关联的字词注册用户界面 (UI)user interface (UI)Displays word registration 用户界面 (UI)user interface (UI) associated with the currently active keyboard text service. 接受指定的字符串作为要注册的默认值,并接受指定的 UIElement 作为配置 UIUI 的父元素。Accepts a specified string as the default value to register, and a specified UIElement as the parent element for the configuration UIUI.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)
VerifyAccess()

强制调用线程具有此 DispatcherObject 的访问权限。Enforces that the calling thread has access to this DispatcherObject.

(继承自 DispatcherObject)

事件

StateChanged

在输入法的状态(由 ImeState 属性表示)更改时发生。Occurs when the input method state (represented by the ImeState property) changes.

适用于

另请参阅