When searching make sure there is any stickers

This commit is contained in:
Jaex 2018-02-08 09:46:18 +03:00
parent 9589820ae5
commit bf8a826f77

View file

@ -67,6 +67,7 @@ public StickerForm(List<StickerPackInfo> stickerPacks, int selectedStickerPack,
private void UpdateStickerPacks()
{
imageFiles = null;
ilvStickers.Items.Clear();
tscbStickers.Items.Clear();
@ -101,16 +102,19 @@ private void UpdateImageFiles()
{
ilvStickers.Items.Clear();
string search = tstbSearch.Text;
string[] currentImageFiles = imageFiles;
if (!string.IsNullOrEmpty(search))
if (imageFiles != null && imageFiles.Length > 0)
{
currentImageFiles = imageFiles.Where(x => x.Contains(search, StringComparison.InvariantCultureIgnoreCase)).ToArray();
}
string[] currentImageFiles = imageFiles;
ilvStickers.Items.AddRange(currentImageFiles);
string search = tstbSearch.Text;
if (!string.IsNullOrEmpty(search))
{
currentImageFiles = imageFiles.Where(x => x.Contains(search, StringComparison.InvariantCultureIgnoreCase)).ToArray();
}
ilvStickers.Items.AddRange(currentImageFiles);
}
}
private void Close(string filePath)