InputLanguageManager 類別

定義

提供在 Windows Presentation Foundation (WPF) 中管理輸入語言的功能。Provides facilities for managing input languages in Windows Presentation Foundation (WPF).

public ref class InputLanguageManager sealed : System::Windows::Threading::DispatcherObject
public sealed class InputLanguageManager : System.Windows.Threading.DispatcherObject
type InputLanguageManager = class
    inherit DispatcherObject
Public NotInheritable Class InputLanguageManager
Inherits DispatcherObject
繼承
InputLanguageManager

範例

下列範例示範如何使用InputLanguageManager來設定TextBox元素的輸入語言。The following example demonstrates how to use an InputLanguageManager to set the input language of a TextBox element.

this.Dispatcher.Thread.CurrentCulture.Name.ToString();
InputLanguageManager.SetInputLanguage(myTextBox, CultureInfo.CreateSpecificCulture("fr"));
tb2.Text = "Available Input Languages:";
lb1.ItemsSource = InputLanguageManager.Current.AvailableInputLanguages;
tb3.Text = "Input Language of myTextBox is " + InputLanguageManager.GetInputLanguage(myTextBox).ToString();
tb4.Text = "CurrentCulture is Set to " + this.Dispatcher.Thread.CurrentCulture.Name.ToString();
Me.Dispatcher.Thread.CurrentCulture.Name.ToString()
InputLanguageManager.SetInputLanguage(myTextBox, CultureInfo.CreateSpecificCulture("fr"))
tb2.Text = "Available Input Languages:"
lb1.ItemsSource = InputLanguageManager.Current.AvailableInputLanguages
tb3.Text = "Input Language of myTextBox is " & InputLanguageManager.GetInputLanguage(myTextBox).ToString()
tb4.Text = "CurrentCulture is Set to " & Me.Dispatcher.Thread.CurrentCulture.Name.ToString()

備註

您可以使用 [地區及語言選項] 控制台來註冊其他語言。Additional languages can be registered by using the Regional and Language Options control panel. 從 [語言] 索引標籤中, 選取 [文字服務和輸入語言], 然後按一下 [詳細資料] 按鈕以註冊其他語言。From the Languages tab, select "Text Services and input languages", then click the "Details" button to register additional languages. 下列對話方塊隨即出現。The following dialog appears.

文字服務和輸入語言對話方塊。Text services and input languages dialog.

欄位

InputLanguageProperty

識別 InputLanguage 附加屬性。Identifies the InputLanguage attached property.

RestoreInputLanguageProperty

識別 RestoreInputLanguage 附加屬性。Identifies the RestoreInputLanguage attached property.

屬性

AvailableInputLanguages

取得目前可用輸入語言的列舉值。Gets an enumerator for currently available input languages.

Current

取得與目前內容關聯的輸入語言管理員。Gets the input language manager associated with the current context.

CurrentInputLanguage

取得或設定目前的輸入語言。Gets or sets the current input language.

Dispatcher

取得與這個 Dispatcher 關聯的 DispatcherObjectGets the Dispatcher this DispatcherObject is associated with.

(繼承來源 DispatcherObject)

附加屬性

InputLanguage

取得或設定相關聯相依性物件的慣用輸入語言。Gets or sets the preferred input language for the associated dependency object.

RestoreInputLanguage

取得或設定值,這個值表示相關聯的相依性物件失去輸入焦點時,是否應該還原先前作用中的輸入語言。Gets or sets a value that indicates whether or not the previously active input language should be restored when the associated dependency object looses the input focus.

方法

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)
GetInputLanguage(DependencyObject)

傳回所指定相依性物件的 InputLanguage 附加屬性值。Returns the value of the InputLanguage attached property for a specified dependency object.

GetRestoreInputLanguage(DependencyObject)

傳回所指定相依性物件的 RestoreInputLanguage 附加屬性值。Returns the value of RestoreInputLanguage 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)
RegisterInputLanguageSource(IInputLanguageSource)

使用 InputLanguageManager 註冊輸入語言來源。Registers an input language source with the InputLanguageManager.

ReportInputLanguageChanged(CultureInfo, CultureInfo)

報告完成 InputLanguageManager 輸入語言的變更。Report the completion of a change of input language to the InputLanguageManager.

ReportInputLanguageChanging(CultureInfo, CultureInfo)

報告開始 InputLanguageManager 輸入語言的變更。Report the initiation of a change of input language to the InputLanguageManager.

SetInputLanguage(DependencyObject, CultureInfo)

設定所指定相依性物件的 InputLanguage 附加屬性值。Sets the value of the InputLanguage attached property on the specified dependency object.

SetRestoreInputLanguage(DependencyObject, Boolean)

在指定的相依性物件上設定 RestoreInputLanguage 相依性屬性的值。Sets the value of the RestoreInputLanguage dependency property on the specified dependency object.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
VerifyAccess()

請強制執行可以存取這個 DispatcherObject 的呼叫執行緒。Enforces that the calling thread has access to this DispatcherObject.

(繼承來源 DispatcherObject)

事件

InputLanguageChanged

發生於完成輸入語言變更時。Occurs when a change of input language is completed.

InputLanguageChanging

發生於開始輸入語言變更時。Occurs when a change of input language is initiated.

適用於

另請參閱