// private methods private INativeLibraryLoader CreateNativeLoader(ILibraryLocator libraryLocator) { var currentPlatform = OperatingSystemHelper.CurrentOperatingSystem; var absolutePath = libraryLocator.GetLibraryAbsolutePath(currentPlatform); return(CreateNativeLoader(currentPlatform, absolutePath)); }
// private methods private INativeLibraryLoader CreateNativeLoader(ILibraryLocator libraryLocator) { var currentPlatform = GetCurrentPlatform(); var absolutePath = libraryLocator.GetLibraryAbsolutePath(currentPlatform); return(CreateNativeLoader(currentPlatform, absolutePath)); }
private void ThrowIfNot64BitProcess(ILibraryLocator libraryLocator) { if (!Environment.Is64BitProcess) { throw new PlatformNotSupportedException($"{libraryLocator.LibraryName} can be loaded only in a 64-bit process."); } }
public LibraryLoader(ILibraryLocator libraryLocator) { Ensure.IsNotNull(libraryLocator, nameof(libraryLocator)); if (!libraryLocator.IsX32ModeSupported) { ThrowIfNot64BitProcess(); } _nativeLoader = CreateNativeLoader(libraryLocator); }
public LibraryLoader(ILibraryLocator libraryLocator) { Ensure.IsNotNull(libraryLocator, nameof(libraryLocator)); ThrowIfNot64BitProcess(); _nativeLoader = CreateNativeLoader(libraryLocator); }
public LibraryLoader(ILibraryLocator libraryLocator) { Ensure.IsNotNull(libraryLocator, nameof(libraryLocator)); _nativeLoader = CreateNativeLoader(libraryLocator); }