Skip to content

Commit

Permalink
避免拖入FTP内或其它特殊位置的文件时阻塞 Explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
STBBRD committed Aug 31, 2024
1 parent 392110c commit 4854aff
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ZongziTEK_Blackboard_Sticker/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,15 @@ private async void window_Drop(object sender, System.Windows.DragEventArgs e)
try { folderFileName = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); }
catch
{
MessageBox.Show("请将此文件拖到桌面空白处", "", MessageBoxButton.OK, MessageBoxImage.Warning);
#pragma warning disable CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法
Task.Run(() =>
{
Dispatcher.Invoke(() =>
{
MessageBox.Show("请将此文件拖到桌面空白处", "", MessageBoxButton.OK, MessageBoxImage.Warning);
});
});
#pragma warning restore CS4014 // 由于此调用不会等待,因此在调用完成前将继续执行当前方法

BorderDragEnter.Visibility = Visibility.Collapsed;
ProgressBarDragEnter.Visibility = Visibility.Collapsed;
Expand Down

0 comments on commit 4854aff

Please sign in to comment.