Audit culture bugs (#7707)

* Added comments and fixed CultureInfo /  StringComparison where appropriate

* Addressed comments

* Fixed comment
This commit is contained in:
Avneet Kaur
2020-10-30 16:43:09 -07:00
committed by GitHub
parent bd34127cd4
commit 2c5b9b4d52
54 changed files with 160 additions and 28 deletions

View File

@@ -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);

View File

@@ -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);
}
}

View File

@@ -54,6 +54,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
set
{
// Using CurrentCulture since this is user facing
searchText = value.ToLower(CultureInfo.CurrentCulture).Trim();
}
}

View File

@@ -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) + ")";
}