支持筛选录像

This commit is contained in:
2021-10-13 20:17:32 +02:00
parent 3f5070df77
commit b92d1d90ad
7 changed files with 205 additions and 43 deletions

View File

@@ -1,4 +1,5 @@
using System;
using NPinyin;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -49,9 +50,21 @@ namespace AnotherReplayReader
private void Display(string filter = "", string nameFilter = "")
{
var pinyin = nameFilter.ToPinyin();
var newList = _identity
.AsSortedList()
.Where(x => x.IPString.StartsWith(filter) && x.ID.StartsWith(nameFilter, StringComparison.CurrentCultureIgnoreCase))
.Where(x =>
{
if (!x.IPString.StartsWith(filter))
{
return false;
}
if (x.PinyinID?.ContainsIgnoreCase(pinyin) is true)
{
return true;
}
return x.ID.ContainsIgnoreCase(nameFilter);
})
.ToArray();
Dispatcher.Invoke(() =>
{