MainWindow.xaml.cs: Update to use IndexStore.Finalize() API matching Rust. Remove CompleteIndex() call that no longer exists.
Browse files
FastSeekWpf/MainWindow.xaml.cs
CHANGED
|
@@ -164,9 +164,7 @@ public partial class MainWindow : Window, INotifyPropertyChanged
|
|
| 164 |
{
|
| 165 |
needFullScan = false;
|
| 166 |
while (_eventQueue.TryDequeue(out var evt))
|
| 167 |
-
{
|
| 168 |
ApplyEvent(evt);
|
| 169 |
-
}
|
| 170 |
Logger.Log("Delta events applied.");
|
| 171 |
}
|
| 172 |
else
|
|
@@ -213,7 +211,7 @@ public partial class MainWindow : Window, INotifyPropertyChanged
|
|
| 213 |
Logger.Log($"Scan failed for {drive.Letter}: {ex}");
|
| 214 |
}
|
| 215 |
}
|
| 216 |
-
_index.
|
| 217 |
Logger.Log($"Full scan complete. Total indexed: {_index.Count}");
|
| 218 |
CacheManager.SaveCache(_index);
|
| 219 |
Logger.Log("Cache saved.");
|
|
@@ -277,9 +275,7 @@ public partial class MainWindow : Window, INotifyPropertyChanged
|
|
| 277 |
if (processed > 100) break;
|
| 278 |
}
|
| 279 |
if (processed > 50)
|
| 280 |
-
{
|
| 281 |
CacheManager.SaveCache(_index);
|
| 282 |
-
}
|
| 283 |
Thread.Sleep(100);
|
| 284 |
}
|
| 285 |
}
|
|
@@ -316,10 +312,7 @@ public partial class MainWindow : Window, INotifyPropertyChanged
|
|
| 316 |
return IntPtr.Zero;
|
| 317 |
}
|
| 318 |
|
| 319 |
-
private void Window_Deactivated(object sender, EventArgs e)
|
| 320 |
-
{
|
| 321 |
-
FadeOutAndHide();
|
| 322 |
-
}
|
| 323 |
|
| 324 |
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
| 325 |
{
|
|
@@ -331,11 +324,7 @@ public partial class MainWindow : Window, INotifyPropertyChanged
|
|
| 331 |
{
|
| 332 |
if (Resources["FadeAnim"] is Storyboard fade)
|
| 333 |
{
|
| 334 |
-
fade.Completed += (s, e) =>
|
| 335 |
-
{
|
| 336 |
-
Hide();
|
| 337 |
-
_isVisible = false;
|
| 338 |
-
};
|
| 339 |
fade.Begin(this);
|
| 340 |
}
|
| 341 |
else
|
|
@@ -348,9 +337,7 @@ public partial class MainWindow : Window, INotifyPropertyChanged
|
|
| 348 |
private void ToggleVisibility()
|
| 349 |
{
|
| 350 |
if (_isVisible)
|
| 351 |
-
{
|
| 352 |
FadeOutAndHide();
|
| 353 |
-
}
|
| 354 |
else
|
| 355 |
{
|
| 356 |
CenterWindow();
|
|
@@ -362,13 +349,9 @@ public partial class MainWindow : Window, INotifyPropertyChanged
|
|
| 362 |
SearchBox.Focus();
|
| 363 |
|
| 364 |
if (Resources["AppearAnim"] is Storyboard appear)
|
| 365 |
-
{
|
| 366 |
appear.Begin(this);
|
| 367 |
-
}
|
| 368 |
else
|
| 369 |
-
{
|
| 370 |
Opacity = 1;
|
| 371 |
-
}
|
| 372 |
_isVisible = true;
|
| 373 |
}
|
| 374 |
}
|
|
@@ -412,10 +395,7 @@ public partial class MainWindow : Window, INotifyPropertyChanged
|
|
| 412 |
}
|
| 413 |
}
|
| 414 |
|
| 415 |
-
private void SearchBox_Loaded(object sender, RoutedEventArgs e)
|
| 416 |
-
{
|
| 417 |
-
SearchBox.Focus();
|
| 418 |
-
}
|
| 419 |
|
| 420 |
private void SearchBox_TextChanged(object sender, TextChangedEventArgs e)
|
| 421 |
{
|
|
|
|
| 164 |
{
|
| 165 |
needFullScan = false;
|
| 166 |
while (_eventQueue.TryDequeue(out var evt))
|
|
|
|
| 167 |
ApplyEvent(evt);
|
|
|
|
| 168 |
Logger.Log("Delta events applied.");
|
| 169 |
}
|
| 170 |
else
|
|
|
|
| 211 |
Logger.Log($"Scan failed for {drive.Letter}: {ex}");
|
| 212 |
}
|
| 213 |
}
|
| 214 |
+
_index.Finalize();
|
| 215 |
Logger.Log($"Full scan complete. Total indexed: {_index.Count}");
|
| 216 |
CacheManager.SaveCache(_index);
|
| 217 |
Logger.Log("Cache saved.");
|
|
|
|
| 275 |
if (processed > 100) break;
|
| 276 |
}
|
| 277 |
if (processed > 50)
|
|
|
|
| 278 |
CacheManager.SaveCache(_index);
|
|
|
|
| 279 |
Thread.Sleep(100);
|
| 280 |
}
|
| 281 |
}
|
|
|
|
| 312 |
return IntPtr.Zero;
|
| 313 |
}
|
| 314 |
|
| 315 |
+
private void Window_Deactivated(object sender, EventArgs e) => FadeOutAndHide();
|
|
|
|
|
|
|
|
|
|
| 316 |
|
| 317 |
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
| 318 |
{
|
|
|
|
| 324 |
{
|
| 325 |
if (Resources["FadeAnim"] is Storyboard fade)
|
| 326 |
{
|
| 327 |
+
fade.Completed += (s, e) => { Hide(); _isVisible = false; };
|
|
|
|
|
|
|
|
|
|
|
|
|
| 328 |
fade.Begin(this);
|
| 329 |
}
|
| 330 |
else
|
|
|
|
| 337 |
private void ToggleVisibility()
|
| 338 |
{
|
| 339 |
if (_isVisible)
|
|
|
|
| 340 |
FadeOutAndHide();
|
|
|
|
| 341 |
else
|
| 342 |
{
|
| 343 |
CenterWindow();
|
|
|
|
| 349 |
SearchBox.Focus();
|
| 350 |
|
| 351 |
if (Resources["AppearAnim"] is Storyboard appear)
|
|
|
|
| 352 |
appear.Begin(this);
|
|
|
|
| 353 |
else
|
|
|
|
| 354 |
Opacity = 1;
|
|
|
|
| 355 |
_isVisible = true;
|
| 356 |
}
|
| 357 |
}
|
|
|
|
| 395 |
}
|
| 396 |
}
|
| 397 |
|
| 398 |
+
private void SearchBox_Loaded(object sender, RoutedEventArgs e) => SearchBox.Focus();
|
|
|
|
|
|
|
|
|
|
| 399 |
|
| 400 |
private void SearchBox_TextChanged(object sender, TextChangedEventArgs e)
|
| 401 |
{
|