Improve namespace and assmebly names.

This commit is contained in:
2025-08-17 05:35:47 +02:00
parent d7d3738801
commit f4aa8e7075
5 changed files with 13 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
using System;
using System.Runtime.InteropServices;
namespace NativeFileDialogSharp.Native
namespace NativeFileDialog.Native
{
public struct nfdpathset_t
{
@@ -55,7 +55,7 @@ namespace NativeFileDialogSharp.Native
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern unsafe void NFD_Free(IntPtr ptr);
}
public static class NativeFunctions32
{
public const string LibraryName = "nfd_x86";

View File

@@ -3,22 +3,22 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
using NativeFileDialogSharp.Native;
using NativeFileDialog.Native;
namespace NativeFileDialogSharp
namespace NativeFileDialog
{
public static class Dialog
{
private static readonly Encoder utf8encoder = Encoding.UTF8.GetEncoder();
private static readonly bool need32bit = Is32BitWindowsOnNetFramework();
private static bool Is32BitWindowsOnNetFramework()
{
try
{
// we call a function that does nothing just to test if we can load it properly
NativeFileDialogSharp.Native.NativeFunctions.NFD_Dummy();
NativeFileDialog.Native.NativeFunctions.NFD_Dummy();
return false;
}
catch
@@ -26,7 +26,7 @@ namespace NativeFileDialogSharp
// a call to a default library failed, let's attempt the other one
try
{
NativeFileDialogSharp.Native.NativeFunctions32.NFD_Dummy();
NativeFileDialog.Native.NativeFunctions32.NFD_Dummy();
return true;
}
catch
@@ -78,7 +78,7 @@ namespace NativeFileDialogSharp
string path = null;
string errorMessage = null;
IntPtr outPathIntPtr;
var result = need32bit
var result = need32bit
? NativeFunctions32.NFD_OpenDialog(filterListNts, defaultPathNts, out outPathIntPtr)
: NativeFunctions.NFD_OpenDialog(filterListNts, defaultPathNts, out outPathIntPtr);
if (result == nfdresult_t.NFD_ERROR)
@@ -104,8 +104,8 @@ namespace NativeFileDialogSharp
string path = null;
string errorMessage = null;
IntPtr outPathIntPtr;
var result = need32bit
? NativeFunctions32.NFD_SaveDialog(filterListNts, defaultPathNts, out outPathIntPtr)
var result = need32bit
? NativeFunctions32.NFD_SaveDialog(filterListNts, defaultPathNts, out outPathIntPtr)
: NativeFunctions.NFD_SaveDialog(filterListNts, defaultPathNts, out outPathIntPtr);
if (result == nfdresult_t.NFD_ERROR)
{

View File

@@ -1,6 +1,6 @@
{
"name": "NativeFileDialogSharp",
"rootNamespace": "NativeFileDialogSharp",
"name": "Shazbot.NativeFileDialog",
"rootNamespace": "NativeFileDialog",
"references": [],
"includePlatforms": [
"Editor",