Skip to content

Commit

Permalink
Fixed ignore case search option by respecting current culture
Browse files Browse the repository at this point in the history
  • Loading branch information
MBulli committed Oct 22, 2017
1 parent e83c1d0 commit fa820ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions SmartCmdArgs/SmartCmdArgs/Helper/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@ public static FileSystemWatcherDisabledContext TemporarilyDisable(this System.IO
{
return new FileSystemWatcherDisabledContext(watcher);
}

public static bool Contains(this string str, string value, StringComparison comparisonType)
{
return str.IndexOf(value, comparisonType) >= 0;
}
}
}
3 changes: 1 addition & 2 deletions SmartCmdArgs/SmartCmdArgs/ViewModel/ListViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ public void SetStringFilter(string filter, bool matchCase = false)
}
else
{
filter = filter.ToLower();
DataCollectionView.Filter = item => ((CmdArgItem) item).Command.ToLower().Contains(filter);
DataCollectionView.Filter = item => ((CmdArgItem) item).Command.Contains(filter, StringComparison.CurrentCultureIgnoreCase);
}
}
});
Expand Down

0 comments on commit fa820ca

Please sign in to comment.