feat:记忆上次被选择的文件夹
This commit is contained in:
1 parent
b9d2b0100a
commit
ffa321a5fc
5 files changed
+108
No files matched your search
@@ -91,10 +91,17 @@ namespace H5MotaUpdate.ViewModels
|
||||
{
|
||||
using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
|
||||
{
|
||||
// 设置初始路径为上一次选择的路径
|
||||
folderBrowserDialog.SelectedPath = Properties.Settings.Default.LastSourceFolderPath;
|
||||
|
||||
if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
SourceRootDirectory = folderBrowserDialog.SelectedPath;
|
||||
// 保存本次选择的路径
|
||||
Properties.Settings.Default.LastSourceFolderPath = SourceRootDirectory;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
VersionString = VersionUtils.GetVersion(SourceRootDirectory);
|
||||
}
|
||||
}
|
||||
@@ -106,9 +113,15 @@ namespace H5MotaUpdate.ViewModels
|
||||
{
|
||||
using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
|
||||
{
|
||||
// 设置初始路径为上一次选择的路径
|
||||
folderBrowserDialog.SelectedPath = Properties.Settings.Default.LastDestFolderPath;
|
||||
|
||||
if (folderBrowserDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
DestRootDirectory = folderBrowserDialog.SelectedPath;
|
||||
// 保存本次选择的路径
|
||||
Properties.Settings.Default.LastDestFolderPath = DestRootDirectory;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user