|
|
|
@ -79,7 +79,16 @@ namespace Avalonia.Win32 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
frm.Show(hWnd); |
|
|
|
var showResult = frm.Show(hWnd); |
|
|
|
|
|
|
|
if ((uint)showResult == (uint)UnmanagedMethods.HRESULT.E_CANCELLED) |
|
|
|
{ |
|
|
|
return result; |
|
|
|
} |
|
|
|
else if ((uint)showResult != (uint)UnmanagedMethods.HRESULT.S_OK) |
|
|
|
{ |
|
|
|
throw new Win32Exception(showResult); |
|
|
|
} |
|
|
|
|
|
|
|
if (openDialog?.AllowMultiple == true) |
|
|
|
{ |
|
|
|
@ -108,10 +117,6 @@ namespace Avalonia.Win32 |
|
|
|
} |
|
|
|
catch (COMException ex) |
|
|
|
{ |
|
|
|
if ((uint)ex.HResult == (uint)UnmanagedMethods.HRESULT.E_CANCELLED) |
|
|
|
{ |
|
|
|
return result; |
|
|
|
} |
|
|
|
throw new Win32Exception(ex.HResult); |
|
|
|
} |
|
|
|
})!; |
|
|
|
@ -151,7 +156,17 @@ namespace Avalonia.Win32 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
frm.Show(hWnd); |
|
|
|
var showResult = frm.Show(hWnd); |
|
|
|
|
|
|
|
if ((uint)showResult == (uint)UnmanagedMethods.HRESULT.E_CANCELLED) |
|
|
|
{ |
|
|
|
return result; |
|
|
|
} |
|
|
|
else if ((uint)showResult != (uint)UnmanagedMethods.HRESULT.S_OK) |
|
|
|
{ |
|
|
|
throw new Win32Exception(showResult); |
|
|
|
} |
|
|
|
|
|
|
|
if (frm.Result is not null) |
|
|
|
{ |
|
|
|
result = GetAbsoluteFilePath(frm.Result); |
|
|
|
@ -161,10 +176,6 @@ namespace Avalonia.Win32 |
|
|
|
} |
|
|
|
catch (COMException ex) |
|
|
|
{ |
|
|
|
if ((uint)ex.HResult == (uint)UnmanagedMethods.HRESULT.E_CANCELLED) |
|
|
|
{ |
|
|
|
return result; |
|
|
|
} |
|
|
|
throw new Win32Exception(ex.HResult); |
|
|
|
} |
|
|
|
}); |
|
|
|
|