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