还原创建进程模式扫描目录的选择文件夹对话框

This commit is contained in:
ChsBuffer
2020-09-02 13:44:04 +08:00
parent efa1b2ed54
commit bb2fbfaafa
3 changed files with 20 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Microsoft.WindowsAPICodePack.Dialogs;
using Netch.Utils;
namespace Netch.Forms.Mode
@@ -171,10 +172,18 @@ namespace Netch.Forms.Mode
private void ScanButton_Click(object sender, EventArgs e)
{
var dialog = new FolderBrowserDialog();
if (dialog.ShowDialog(this) == DialogResult.OK)
var dialog = new CommonOpenFileDialog
{
ScanDirectory(dialog.SelectedPath);
IsFolderPicker = true,
Multiselect = false,
Title = i18N.Translate("Select a folder"),
AddToMostRecentlyUsedList = false,
EnsurePathExists = true,
NavigateToShortcut = true
};
if (dialog.ShowDialog(Win32Native.GetForegroundWindow()) == CommonFileDialogResult.Ok)
{
ScanDirectory(dialog.FileName);
MessageBoxX.Show(i18N.Translate("Scan completed"));
}
}

View File

@@ -64,6 +64,7 @@
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0-preview.8.20407.11" />
<PackageReference Include="System.Reflection.Metadata" Version="5.0.0-preview.8.20407.11" />
<PackageReference Include="WindowsAPICodePack-Shell" Version="1.1.1" />
</ItemGroup>
<ItemGroup>

View File

@@ -9,10 +9,17 @@ if %Configuration%==Release (
%TargetDir%MaxMind.GeoIP2.dll ^
%TargetDir%Microsoft.Diagnostics.FastSerialization.dll ^
%TargetDir%Microsoft.Diagnostics.Tracing.TraceEvent.dll ^
%TargetDir%Microsoft.WindowsAPICodePack.dll ^
%TargetDir%Microsoft.WindowsAPICodePack.Shell.dll ^
%TargetDir%NetchLib.dll ^
%TargetDir%Newtonsoft.Json.dll ^
%TargetDir%OSExtensions.dll ^
%TargetDir%System.Buffers.dll ^
%TargetDir%System.Collections.Immutable.dll ^
%TargetDir%System.Memory.dll ^
%TargetDir%System.Net.IPNetwork.dll ^
%TargetDir%System.Numerics.Vectors.dll ^
%TargetDir%System.Reflection.Metadata.dll ^
%TargetDir%System.Runtime.CompilerServices.Unsafe.dll ^
%TargetDir%TraceReloggerLib.dll