更新整理

This commit is contained in:
GG Z
2025-04-24 20:56:44 +08:00
parent 155cef46f8
commit 5b6d67b571
813 changed files with 14437 additions and 12362 deletions

View File

@@ -12,12 +12,12 @@ namespace WPFluent.Controls
private Fos GetDialogOptions()
{
Fos options = Fos.Pickfolders;
if(Multiselect)
if (Multiselect)
{
options |= Fos.Allowmultiselect;
}
if(!AllowNonStoragePlaces)
if (!AllowNonStoragePlaces)
{
options |= Fos.Forcefilesystem;
}
@@ -31,7 +31,8 @@ namespace WPFluent.Controls
try
{
item.GetDisplayName(Sigdn.Filesyspath, out path);
} catch(ArgumentException ex) when (ex.HResult == -2147024809)
}
catch (ArgumentException ex) when (ex.HResult == -2147024809)
{
path = null;
}
@@ -40,7 +41,7 @@ namespace WPFluent.Controls
private void SetDialogResults(IFileOpenDialog dialog)
{
IShellItem item;
if(!Multiselect)
if (!Multiselect)
{
dialog.GetResult(out item);
string path, value;
@@ -61,7 +62,7 @@ namespace WPFluent.Controls
SelectedPaths = new string[count];
SelectedElementNames = new string[count];
for(uint i = 0; i < count; ++i)
for (uint i = 0; i < count; ++i)
{
items.GetItemAt(i, out item);
string path, value;
@@ -78,11 +79,11 @@ namespace WPFluent.Controls
private void SetInitialFolder(IFileOpenDialog dialog)
{
IShellItem item;
if(!string.IsNullOrEmpty(SelectedPath))
if (!string.IsNullOrEmpty(SelectedPath))
{
IntPtr idl;
uint atts = 0;
if(NativeMethods.SHILCreateFromPath(SelectedPath, out idl, ref atts) == 0 &&
if (NativeMethods.SHILCreateFromPath(SelectedPath, out idl, ref atts) == 0 &&
NativeMethods.SHCreateShellItem(IntPtr.Zero, IntPtr.Zero, idl, out item) == 0)
{
dialog.SetFolder(item);
@@ -101,7 +102,7 @@ namespace WPFluent.Controls
public bool ShowDialog(IntPtr owner)
{
if(Environment.OSVersion.Version.Major < 6)
if (Environment.OSVersion.Version.Major < 6)
{
throw new InvalidOperationException("对话框需要至少在Visia系统以上才能使用");
}
@@ -112,7 +113,7 @@ namespace WPFluent.Controls
SetInitialFolder(dialog);
SetOptions(dialog);
if(dialog.Show(owner) != 0)
if (dialog.Show(owner) != 0)
{
return false;
}
@@ -120,7 +121,8 @@ namespace WPFluent.Controls
SetDialogResults(dialog);
return true;
} finally
}
finally
{
Marshal.ReleaseComObject(dialog);
}