Add net6.0 target framework

This commit is contained in:
Perfare
2021-12-09 19:00:59 +08:00
parent d220315d9b
commit fe95c91759
7 changed files with 23 additions and 16 deletions

View File

@ -1,5 +1,4 @@
using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows.Forms;
@ -15,12 +14,13 @@ namespace AssetStudioGUI
internal DialogResult ShowDialog(IWin32Window owner = null)
{
#if NETFRAMEWORK
if (Environment.OSVersion.Version.Major >= 6)
{
return ShowVistaDialog(owner);
}
return ShowLegacyDialog(owner);
#endif
return ShowFolderBrowserDialog(owner);
}
private DialogResult ShowVistaDialog(IWin32Window owner)
@ -74,7 +74,7 @@ namespace AssetStudioGUI
return DialogResult.Cancel;
}
private DialogResult ShowLegacyDialog(IWin32Window owner)
private DialogResult ShowFolderBrowserDialog(IWin32Window owner)
{
using (var frm = new FolderBrowserDialog())
{
@ -82,13 +82,20 @@ namespace AssetStudioGUI
{
frm.SelectedPath = InitialFolder;
}
if ((owner == null ? frm.ShowDialog() : frm.ShowDialog(owner)) == DialogResult.OK)
#if !NETFRAMEWORK
if (Title != null)
{
Folder = Path.GetDirectoryName(frm.SelectedPath);
return DialogResult.OK;
frm.Description = Title;
frm.UseDescriptionForTitle = true;
}
return DialogResult.Cancel;
#endif
var result = owner == null ? frm.ShowDialog() : frm.ShowDialog(owner);
if (result == DialogResult.OK)
{
Folder = frm.SelectedPath;
return result;
}
return result;
}
}
}