Improve namespace and assmebly names.
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "NativeFileDialogSharp",
|
||||
"rootNamespace": "NativeFileDialogSharp",
|
||||
"name": "Shazbot.NativeFileDialog",
|
||||
"rootNamespace": "NativeFileDialog",
|
||||
"references": [],
|
||||
"includePlatforms": [
|
||||
"Editor",
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ru.shazbot.nativefiledialog",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"displayName": "Native File Dialog",
|
||||
"description": "Based on https://github.com/milleniumbug/NativeFileDialogSharp",
|
||||
"licensesUrl": "https://git.well-placed.de/InnoLab/NativeFileDialogPackage/src/LICENSE.md",
|
||||
|
||||
Reference in New Issue
Block a user