Fix CA2249, CA2251
This commit is contained in:
committed by
Matthias Mailänder
parent
285443f10f
commit
169c60883b
@@ -491,7 +491,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
public void Do()
|
||||
{
|
||||
actor = editorActorLayer[actorId.ToLowerInvariant()];
|
||||
actor = editorActorLayer[actorId];
|
||||
foreach (var editorActionHandle in handles)
|
||||
editorActionHandle.Do(actor);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (!string.IsNullOrEmpty(searchFilter))
|
||||
FilteredCategories.AddRange(
|
||||
allActors.Where(t => t.SearchTerms.Any(
|
||||
s => s.IndexOf(searchFilter, StringComparison.OrdinalIgnoreCase) >= 0))
|
||||
s => s.Contains(searchFilter, StringComparison.CurrentCultureIgnoreCase)))
|
||||
.SelectMany(t => t.Categories)
|
||||
.Distinct()
|
||||
.OrderBy(x => x));
|
||||
@@ -181,7 +181,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (!SelectedCategories.Overlaps(a.Categories))
|
||||
continue;
|
||||
|
||||
if (!string.IsNullOrEmpty(searchFilter) && !a.SearchTerms.Any(s => s.IndexOf(searchFilter, StringComparison.OrdinalIgnoreCase) >= 0))
|
||||
if (!string.IsNullOrEmpty(searchFilter) &&
|
||||
!a.SearchTerms.Any(s => s.Contains(searchFilter, StringComparison.CurrentCultureIgnoreCase)))
|
||||
continue;
|
||||
|
||||
var actor = a.Actor;
|
||||
|
||||
@@ -102,7 +102,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (!SelectedCategories.Overlaps(t.Categories))
|
||||
continue;
|
||||
|
||||
if (!string.IsNullOrEmpty(searchFilter) && !t.SearchTerms.Any(s => s.IndexOf(searchFilter, StringComparison.OrdinalIgnoreCase) >= 0))
|
||||
if (!string.IsNullOrEmpty(searchFilter) &&
|
||||
!t.SearchTerms.Any(s => s.Contains(searchFilter, StringComparison.CurrentCultureIgnoreCase)))
|
||||
continue;
|
||||
|
||||
var tileId = t.Template.Id;
|
||||
|
||||
@@ -325,8 +325,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var validMaps = tabMaps[tab]
|
||||
.Where(m => category == null || m.Categories.Contains(category))
|
||||
.Where(m => mapFilter == null ||
|
||||
(m.Title != null && m.Title.IndexOf(mapFilter, StringComparison.OrdinalIgnoreCase) >= 0) ||
|
||||
(m.Author != null && m.Author.IndexOf(mapFilter, StringComparison.OrdinalIgnoreCase) >= 0) ||
|
||||
(m.Title != null && m.Title.Contains(mapFilter, StringComparison.CurrentCultureIgnoreCase)) ||
|
||||
(m.Author != null && m.Author.Contains(mapFilter, StringComparison.CurrentCultureIgnoreCase)) ||
|
||||
m.PlayerCount == playerCountFilter);
|
||||
|
||||
IOrderedEnumerable<MapPreview> maps;
|
||||
|
||||
@@ -322,7 +322,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
bool IsHotkeyVisibleInFilter(HotkeyDefinition hd)
|
||||
{
|
||||
var filter = filterInput.Text;
|
||||
var isFilteredByName = string.IsNullOrWhiteSpace(filter) || hd.Description.Contains(filter, StringComparison.OrdinalIgnoreCase);
|
||||
var isFilteredByName = string.IsNullOrWhiteSpace(filter) ||
|
||||
hd.Description.Contains(filter, StringComparison.CurrentCultureIgnoreCase);
|
||||
var isFilteredByContext = currentContext == "Any" || hd.Contexts.Contains(currentContext);
|
||||
|
||||
return isFilteredByName && isFilteredByContext;
|
||||
|
||||
Reference in New Issue
Block a user