3 instantiations of InputLanguage
System.Windows.Forms (3)
System\Windows\Forms\Input\InputLanguage.cs (3)
64
return new
InputLanguage
(handle);
239
return new InputLanguageChangedEventArgs(new
InputLanguage
(m.LParamInternal), (byte)(nint)m.WParamInternal);
247
InputLanguage inputLanguage =
new
(m.LParamInternal);
88 references to InputLanguage
System.Windows.Forms (34)
System\Windows\Forms\Application.cs (3)
233
public static
InputLanguage
CurrentInputLanguage
235
get =>
InputLanguage
.CurrentInputLanguage;
236
set =>
InputLanguage
.CurrentInputLanguage = value;
System\Windows\Forms\Control.Ime.cs (4)
520
InputLanguageChangedEventArgs e =
InputLanguage
.CreateInputLanguageChangedEventArgs(m);
532
InputLanguageChangingEventArgs e =
InputLanguage
.CreateInputLanguageChangingEventArgs(m);
1042
InputLanguage
inputLanguage =
InputLanguage
.CurrentInputLanguage;
System\Windows\Forms\Input\InputLanguage.cs (8)
34
public static
InputLanguage
CurrentInputLanguage
58
public static
InputLanguage
DefaultInputLanguage
89
InputLanguage
[] ils = new
InputLanguage
[size];
247
InputLanguage
inputLanguage = new(m.LParamInternal);
258
=> value is
InputLanguage
other && _handle == other._handle;
263
public static
InputLanguage
? FromCulture(CultureInfo culture)
267
foreach (
InputLanguage
? lang in InstalledInputLanguages)
System\Windows\Forms\Input\InputLanguageChangedEventArgs.cs (4)
19
InputLanguage
? language =
InputLanguage
.FromCulture(culture)
31
public InputLanguageChangedEventArgs(
InputLanguage
inputLanguage, byte charSet)
41
public
InputLanguage
InputLanguage { get; }
System\Windows\Forms\Input\InputLanguageChangingEventArgs.cs (4)
20
InputLanguage
? language =
InputLanguage
.FromCulture(culture)
32
public InputLanguageChangingEventArgs(
InputLanguage
inputLanguage, bool sysCharSet)
42
public
InputLanguage
InputLanguage { get; }
System\Windows\Forms\Input\InputLanguageCollection.cs (11)
9
/// A collection that stores <see cref="
InputLanguage
"/> objects.
15
/// <see cref="
InputLanguage
"/> objects.
17
internal InputLanguageCollection(
InputLanguage
[] value)
26
/// Represents the entry at the specified index of the <see cref="
InputLanguage
"/>.
28
public
InputLanguage
this[int index] => (
InputLanguage
)InnerList[index]!; // Forcing non-nullable due to legacy requirements.
32
/// <see cref="InputLanguageCollection"/> contains the specified <see cref="
InputLanguage
"/>.
34
public bool Contains(
InputLanguage
? value) => InnerList.Contains(value);
40
public void CopyTo(
InputLanguage
[] array, int index) => InnerList.CopyTo(array, index);
43
/// Returns the index of a <see cref="
InputLanguage
"/> in
46
public int IndexOf(
InputLanguage
? value) => InnerList.IndexOf(value);
System.Windows.Forms.Tests (53)
System\Windows\Forms\InputLanguageChangedEventArgsTests.cs (5)
22
Assert.Equal(
InputLanguage
.FromCulture(culture), e.InputLanguage);
48
yield return new object[] {
InputLanguage
.FromCulture(CultureInfo.InvariantCulture), 0 };
49
yield return new object[] {
InputLanguage
.FromCulture(new CultureInfo("en")), 1 };
54
public void Ctor_InputLanguage_Byte(
InputLanguage
inputLanguage, byte charSet)
71
Assert.Throws<ArgumentNullException>("inputLanguage", () => new InputLanguageChangedEventArgs((
InputLanguage
)null, 0));
System\Windows\Forms\InputLanguageChangingEventArgsTests.cs (5)
22
Assert.Equal(
InputLanguage
.FromCulture(culture), e.InputLanguage);
49
yield return new object[] {
InputLanguage
.FromCulture(CultureInfo.InvariantCulture), true };
50
yield return new object[] {
InputLanguage
.FromCulture(new CultureInfo("en")), false };
55
public void Ctor_InputLanguage_Bool(
InputLanguage
inputLanguage, bool sysCharSet)
72
Assert.Throws<ArgumentNullException>("inputLanguage", () => new InputLanguageChangingEventArgs((
InputLanguage
)null, true));
System\Windows\Forms\InputLanguageTests.cs (43)
16
InputLanguageCollection collection =
InputLanguage
.InstalledInputLanguages;
17
Assert.NotSame(collection,
InputLanguage
.InstalledInputLanguages);
19
Assert.All(collection.Cast<
InputLanguage
>(), VerifyInputLanguage);
25
InputLanguage
language =
InputLanguage
.DefaultInputLanguage;
26
Assert.NotSame(language,
InputLanguage
.DefaultInputLanguage);
33
InputLanguage
language =
InputLanguage
.CurrentInputLanguage;
34
Assert.NotSame(language,
InputLanguage
.CurrentInputLanguage);
41
InputLanguage
language =
InputLanguage
.CurrentInputLanguage;
45
InputLanguage
.CurrentInputLanguage = null;
46
Assert.Equal(
InputLanguage
.DefaultInputLanguage,
InputLanguage
.CurrentInputLanguage);
49
InputLanguage
.CurrentInputLanguage = language;
50
Assert.Equal(language,
InputLanguage
.CurrentInputLanguage);
53
InputLanguage
.CurrentInputLanguage = language;
54
Assert.Equal(language,
InputLanguage
.CurrentInputLanguage);
58
InputLanguage
.CurrentInputLanguage = language;
65
InputLanguage
language = Assert.IsType<
InputLanguage
>(Activator.CreateInstance(typeof(
InputLanguage
), BindingFlags.Instance | BindingFlags.NonPublic, null, [(IntPtr)250], null));
66
Assert.Throws<ArgumentException>("value", () =>
InputLanguage
.CurrentInputLanguage = language);
71
yield return new object[] {
InputLanguage
.DefaultInputLanguage,
InputLanguage
.DefaultInputLanguage, true };
72
yield return new object[] {
InputLanguage
.DefaultInputLanguage, new(), false };
73
yield return new object[] {
InputLanguage
.DefaultInputLanguage, null, false };
78
public void InputLanguage_Equals_Invoke_ReturnsExpected(
InputLanguage
language, object value, bool expected)
86
InputLanguage
language =
InputLanguage
.CurrentInputLanguage;
87
InputLanguage
result =
InputLanguage
.FromCulture(language.Culture);
97
Assert.Null(
InputLanguage
.FromCulture(invariantCulture));
103
Assert.Throws<ArgumentNullException>("culture", () =>
InputLanguage
.FromCulture(null));
109
InputLanguage
language =
InputLanguage
.CurrentInputLanguage;
127
InputLanguage
language = new(PARAM.FromLowHigh(langId, device));
156
InputLanguage
language =
InputLanguage
.FromCulture(culture);
170
InputLanguage
language = new(PARAM.FromLowHigh(langId, device));
179
InputLanguage
language = new(PARAM.FromLowHigh(langId, device));
183
private static void VerifyInputLanguage(
InputLanguage
language, string languageTag, string layoutId, string layoutName)
192
private static void VerifyInputLanguage(
InputLanguage
language)
System.Windows.Forms.UI.IntegrationTests (1)
ButtonTests.cs (1)
361
Assert.True(
InputLanguage
.CurrentInputLanguage.LayoutName == "US", "Please, switch to the US input language");