EveryThing搜索优化

This commit is contained in:
BookerLiu
2023-04-04 17:59:06 +08:00
parent 3654ec393a
commit 1fce566f4a
8 changed files with 1533 additions and 36 deletions

View File

@@ -128,7 +128,7 @@ namespace GeekDesk
if (!RunTimeStatus.EVERYTHING_NEW_SEARCH)
{
RunTimeStatus.EVERYTHING_NEW_SEARCH = true;
SearchDelay(null, null);
SearchDelay();
}
} else
{
@@ -143,7 +143,7 @@ namespace GeekDesk
}
private void SearchDelay(object sender, EventArgs args)
private void SearchDelay()
{
new Thread(() =>
@@ -163,8 +163,7 @@ namespace GeekDesk
{
SearchIconList.RemoveAll();
}
//DelayHelper dh = sender as DelayHelper;
//string inpuText = dh.Source as string;
string inputText = SearchBox.Text.ToLower().Trim();
int count = 0;
@@ -215,7 +214,7 @@ namespace GeekDesk
this.Dispatcher.Invoke(() =>
{
icon.BitmapImage_NoWrite = ImageUtil.GetBitmapIconByUnknownPath(icon.Path);
});
}, DispatcherPriority.SystemIdle);
}
}).Start();
}
@@ -245,18 +244,23 @@ namespace GeekDesk
Thread.Sleep(1000);
RunTimeStatus.EVERYTHING_NEW_SEARCH = false;
}).Start();
new Thread(() =>
{
this.Dispatcher.Invoke(() =>
{
Keyboard.Focus(SearchBox);
RunTimeStatus.SEARCH_BOX_SHOW = false;
SearchBox.TextChanged -= SearchBox_TextChanged;
SearchBox.Clear();
SearchBox.TextChanged += SearchBox_TextChanged;
SearchBox.Width = 0;
TotalMsgBtn.Content = "0 of 0";
TotalMsgBtn.Visibility = Visibility.Hidden;
RightCard.VisibilitySearchCard(Visibility.Collapsed);
Keyboard.Focus(SearchBox);
RunTimeStatus.SEARCH_BOX_SHOW = false;
SearchBox.TextChanged -= SearchBox_TextChanged;
SearchBox.Clear();
SearchBox.TextChanged += SearchBox_TextChanged;
SearchBox.Width = 0;
TotalMsgBtn.Content = "0 of 0";
TotalMsgBtn.Visibility = Visibility.Hidden;
RightCard.VisibilitySearchCard(Visibility.Collapsed);
SearchIconList.RemoveAll();
SearchIconList.RemoveAll();
});
}).Start();
}