mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
Audit culture bugs (#7707)
* Added comments and fixed CultureInfo / StringComparison where appropriate * Addressed comments * Fixed comment
This commit is contained in:
@@ -37,6 +37,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
throw new ArgumentNullException(nameof(text));
|
||||
}
|
||||
|
||||
// Using CurrentCulture since this is user facing
|
||||
searchText = searchText.ToLower(CultureInfo.CurrentCulture);
|
||||
text = text.ToLower(CultureInfo.CurrentCulture);
|
||||
|
||||
|
||||
@@ -563,6 +563,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
// Using CurrentCulture since this is user facing
|
||||
return string.Format(System.Globalization.CultureInfo.CurrentCulture, "{{Left={0},Top={1},Right={2},Bottom={3}}}", Left, Top, Right, Bottom);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
|
||||
set
|
||||
{
|
||||
// Using CurrentCulture since this is user facing
|
||||
searchText = value.ToLower(CultureInfo.CurrentCulture).Trim();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,6 +252,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
// 1) There is a weird flashing behavior when trying
|
||||
// to use ShowWindow for switching tabs in IE
|
||||
// 2) SetForegroundWindow fails on minimized windows
|
||||
// Using Ordinal since this is internal
|
||||
if (ProcessName.ToUpperInvariant().Equals("IEXPLORE.EXE", StringComparison.Ordinal) || !Minimized)
|
||||
{
|
||||
NativeMethods.SetForegroundWindow(Hwnd);
|
||||
@@ -270,6 +271,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
|
||||
/// <returns>The title of the window</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
// Using CurrentCulture since this is user facing
|
||||
return Title + " (" + ProcessName.ToUpper(CultureInfo.CurrentCulture) + ")";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user