/// <summary> /// Loads a native (unmanaged) dynamically loaded library. /// </summary> /// <param name="name">Library name. Can be a full path as well.</param> /// <param name="options">Load options.</param> /// <param name="library">When the method returns, contains an instance of <see cref="NativeLibrary"/> on success, or null on failure.</returns> /// <returns>True on succes; false on failure.</returns> public static bool TryLoad(string name, NativeLibraryLoadOptions options, out NativeLibrary library) { library = Load(name, false, options, ((options & NativeLibraryLoadOptions.SearchAssemblyDirectory) != 0) ? Assembly.GetCallingAssembly() : null); return(library != null); }
/// <summary> /// Loads a native (unmanaged) dynamically loaded library. /// </summary> /// <param name="name">Library name. Can be a full path as well.</param> /// <param name="library">When the method returns, contains an instance of <see cref="NativeLibrary"/> on success, or null on failure.</returns> /// <returns>True on succes; false on failure.</returns> public static bool TryLoad(string name, out NativeLibrary library) { library = Load(name, false, NativeLibraryLoadOptions.None, null); return(library != null); }