private GmicNativeMethods(IntPtr libraryHandle, LibraryLoader loader) { getLibraryVersion = loader.GetExport <GetLibraryVersionDelegate>(libraryHandle, "GetLibraryVersion"); gmicImageListCreate = loader.GetExport <GmicImageListCreateDelegate>(libraryHandle, "GmicImageListCreate"); gmicImageListDestroy = loader.GetExport <GmicImageListDestroyDelegate>(libraryHandle, "GmicImageListDestroy"); gmicImageListClear = loader.GetExport <GmicImageListClearDelegate>(libraryHandle, "GmicImageListClear"); gmicImageListGetCount = loader.GetExport <GmicImageListGetCountDelegate>(libraryHandle, "GmicImageListGetCount"); gmicImageListGetImageData = loader.GetExport <GmicImageListGetImageDataDelegate>(libraryHandle, "GmicImageListGetImageData"); gmicImageListAdd = loader.GetExport <GmicImageListAddDelegate>(libraryHandle, "GmicImageListAdd"); runGmic = loader.GetExport <RunGmicDelegate>(libraryHandle, "RunGmic"); }
public static void Initialize(IntPtr libraryHandle, LibraryLoader loader) { if (libraryHandle == IntPtr.Zero) { ExceptionUtil.ThrowArgumentNullException(nameof(libraryHandle)); } if (loader is null) { ExceptionUtil.ThrowArgumentNullException(nameof(loader)); } if (instance == null) { instance = new GmicNativeMethods(libraryHandle, loader); } }