mirror of
https://github.com/AssetRipper/NativeFileDialogs.NET.git
synced 2026-11-13 20:05:46 -10:00
Extension to convert NfdresultT to NfdStatus
This commit is contained in:
1 file changed
+20
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) Speykious
|
||||
// This file is part of NativeFileDialogs.NET.
|
||||
// NativeFileDialogs.NET is licensed under the Zlib License. See LICENSE for details.
|
||||
|
||||
using NativeFileDialogs.AutoGen;
|
||||
|
||||
namespace NativeFileDialogs.Net;
|
||||
|
||||
internal static class NfdresultTExtensions
|
||||
{
|
||||
public static NfdStatus ToNfdStatus(this NfdresultT result)
|
||||
{
|
||||
return result switch
|
||||
{
|
||||
NfdresultT.NFD_OKAY => NfdStatus.Ok,
|
||||
NfdresultT.NFD_CANCEL => NfdStatus.Cancelled,
|
||||
_ => throw new NfdException(),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user