NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

InputLanguage.Equals

Specifies whether two input languages are equal.

[Visual Basic]
Shadows Public Function Equals( _
   ByVal inputLanguage As InputLanguage _
) As Boolean
[C#]
public new bool Equals(
   InputLanguage inputLanguage
);
[C++]
public: new bool Equals(
   InputLanguage* inputLanguage
);
[JScript]
public new function Equals(
   inputLanguage : InputLanguage
) : Boolean;

Parameters

inputLanguage
The InputLanguage to test for equality.

Return Value

true if this instance and the specified inputLanguage represent the same input language; otherwise, false.

Example [C#]

The following example compares the current input language and the default input language, and displays the result. First, GetDefaultInputLanguage is called to get the system default language. Then GetCurrentInputLanguage is called to get the current input language. Finally, Equals is called to compare the two languages. The languages and the result of the comparison are displayed in a text box.

This example assumes that textBox1 has been instantiated.

[C#]

public void IsEqual() {
   //Get the default and current languages.
   InputLanguage myDefaultLanguage = InputLanguage.GetDefaultInputLanguage();
   InputLanguage myCurrentLanguage = InputLanguage.GetCurrentInputLanguage();

   //Compare the languages and print the result.
   if(myDefaultLanguage.Equals(myCurrentLanguage)) {
      textBox1.Text = "Current and default input languages are the same. " + '\n';
      textBox1.Text += "Input language is: " + myCurrentLanguage.GetCulture().EnglishName;
   }
   else {
      textBox1.Text = "Current and default input languages are not the same. " + '\n';
      textBox1.Text += "Current input language is: " + myCurrentLanguage.GetCulture().EnglishName;
      textBox1.Text += "Default input language is: " + myDefaultLanguage.GetCulture().EnglishName;
   }
}

See Also

InputLanguage Class | InputLanguage Members | System.WinForms Namespace | SetCurrentInputLanguage | GetDefaultInputLanguage