Improve namespace and assmebly names.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace NativeFileDialogSharp.Native
|
namespace NativeFileDialog.Native
|
||||||
{
|
{
|
||||||
public struct nfdpathset_t
|
public struct nfdpathset_t
|
||||||
{
|
{
|
||||||
@@ -55,7 +55,7 @@ namespace NativeFileDialogSharp.Native
|
|||||||
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
[DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
|
||||||
public static extern unsafe void NFD_Free(IntPtr ptr);
|
public static extern unsafe void NFD_Free(IntPtr ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class NativeFunctions32
|
public static class NativeFunctions32
|
||||||
{
|
{
|
||||||
public const string LibraryName = "nfd_x86";
|
public const string LibraryName = "nfd_x86";
|
||||||
|
|||||||
@@ -3,22 +3,22 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using NativeFileDialogSharp.Native;
|
using NativeFileDialog.Native;
|
||||||
|
|
||||||
namespace NativeFileDialogSharp
|
namespace NativeFileDialog
|
||||||
{
|
{
|
||||||
public static class Dialog
|
public static class Dialog
|
||||||
{
|
{
|
||||||
private static readonly Encoder utf8encoder = Encoding.UTF8.GetEncoder();
|
private static readonly Encoder utf8encoder = Encoding.UTF8.GetEncoder();
|
||||||
|
|
||||||
private static readonly bool need32bit = Is32BitWindowsOnNetFramework();
|
private static readonly bool need32bit = Is32BitWindowsOnNetFramework();
|
||||||
|
|
||||||
private static bool Is32BitWindowsOnNetFramework()
|
private static bool Is32BitWindowsOnNetFramework()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// we call a function that does nothing just to test if we can load it properly
|
// 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;
|
return false;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
@@ -26,7 +26,7 @@ namespace NativeFileDialogSharp
|
|||||||
// a call to a default library failed, let's attempt the other one
|
// a call to a default library failed, let's attempt the other one
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
NativeFileDialogSharp.Native.NativeFunctions32.NFD_Dummy();
|
NativeFileDialog.Native.NativeFunctions32.NFD_Dummy();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
@@ -78,7 +78,7 @@ namespace NativeFileDialogSharp
|
|||||||
string path = null;
|
string path = null;
|
||||||
string errorMessage = null;
|
string errorMessage = null;
|
||||||
IntPtr outPathIntPtr;
|
IntPtr outPathIntPtr;
|
||||||
var result = need32bit
|
var result = need32bit
|
||||||
? NativeFunctions32.NFD_OpenDialog(filterListNts, defaultPathNts, out outPathIntPtr)
|
? NativeFunctions32.NFD_OpenDialog(filterListNts, defaultPathNts, out outPathIntPtr)
|
||||||
: NativeFunctions.NFD_OpenDialog(filterListNts, defaultPathNts, out outPathIntPtr);
|
: NativeFunctions.NFD_OpenDialog(filterListNts, defaultPathNts, out outPathIntPtr);
|
||||||
if (result == nfdresult_t.NFD_ERROR)
|
if (result == nfdresult_t.NFD_ERROR)
|
||||||
@@ -104,8 +104,8 @@ namespace NativeFileDialogSharp
|
|||||||
string path = null;
|
string path = null;
|
||||||
string errorMessage = null;
|
string errorMessage = null;
|
||||||
IntPtr outPathIntPtr;
|
IntPtr outPathIntPtr;
|
||||||
var result = need32bit
|
var result = need32bit
|
||||||
? NativeFunctions32.NFD_SaveDialog(filterListNts, defaultPathNts, out outPathIntPtr)
|
? NativeFunctions32.NFD_SaveDialog(filterListNts, defaultPathNts, out outPathIntPtr)
|
||||||
: NativeFunctions.NFD_SaveDialog(filterListNts, defaultPathNts, out outPathIntPtr);
|
: NativeFunctions.NFD_SaveDialog(filterListNts, defaultPathNts, out outPathIntPtr);
|
||||||
if (result == nfdresult_t.NFD_ERROR)
|
if (result == nfdresult_t.NFD_ERROR)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "NativeFileDialogSharp",
|
"name": "Shazbot.NativeFileDialog",
|
||||||
"rootNamespace": "NativeFileDialogSharp",
|
"rootNamespace": "NativeFileDialog",
|
||||||
"references": [],
|
"references": [],
|
||||||
"includePlatforms": [
|
"includePlatforms": [
|
||||||
"Editor",
|
"Editor",
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ru.shazbot.nativefiledialog",
|
"name": "ru.shazbot.nativefiledialog",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"displayName": "Native File Dialog",
|
"displayName": "Native File Dialog",
|
||||||
"description": "Based on https://github.com/milleniumbug/NativeFileDialogSharp",
|
"description": "Based on https://github.com/milleniumbug/NativeFileDialogSharp",
|
||||||
"licensesUrl": "https://git.well-placed.de/InnoLab/NativeFileDialogPackage/src/LICENSE.md",
|
"licensesUrl": "https://git.well-placed.de/InnoLab/NativeFileDialogPackage/src/LICENSE.md",
|
||||||
|
|||||||
Reference in New Issue
Block a user