Пример #1
0
        /// <summary>
        ///     Load a bass plug-in, it will auto find plug-in DLL file.
        /// </summary>
        /// <param name="plugin">Plug-in type.</param>
        /// <returns>Bass plug-in object.</returns>
        public static Plugin LoadPlugin(BassPlugin plugin)
        {
            var files = Directory.GetFiles(BassManager.BassLibraryDirectory, plugin.GetPluginName());

            if (files.Length != 0)
            {
                return(LoadPlugin(plugin, files[0]));
            }

            files = Directory.GetFiles(Directory.GetCurrentDirectory(), plugin.GetPluginName());

            if (files.Length != 0)
            {
                return(LoadPlugin(plugin, files[0]));
            }

            throw new BassPluginNotFoundException(BassManager.BassLibraryDirectory, plugin);
        }
Пример #2
0
        /// <summary>
        ///     Load a bass plug-in, it will auto find plug-in DLL file.
        /// </summary>
        /// <param name="plugin">Plug-in type.</param>
        /// <returns>Bass plug-in object.</returns>
        public static Plugin LoadPlugin(BassPlugin plugin)
        {
            var files = Directory.GetFiles(BassManager.BassLibraryDirectory, plugin.GetPluginName());

            if (files.Length != 0)
            {
                return LoadPlugin(plugin, files[0]);
            }

            files = Directory.GetFiles(Directory.GetCurrentDirectory(), plugin.GetPluginName());

            if (files.Length != 0)
            {
                return LoadPlugin(plugin, files[0]);
            }

            throw new BassPluginNotFoundException(BassManager.BassLibraryDirectory, plugin);
        }
Пример #3
0
        /// <summary>
        ///     Load a bass plug-in with a DLL path or directory.
        /// </summary>
        /// <param name="plugin">Plug-in type.</param>
        /// <param name="path">Plug-in DLL path or directory.</param>
        /// <returns>Bass plug-in object.</returns>
        public static Plugin LoadPlugin(BassPlugin plugin, string path)
        {
            if (File.Exists(path))
            {
                return(new Plugin(path, plugin));
            }

            if (Directory.Exists(path))
            {
                var files = Directory.GetFiles(path, plugin.GetPluginName());

                if (files.Length != 0)
                {
                    return(new Plugin(files[0], plugin));
                }
            }

            throw new BassPluginNotFoundException(BassManager.BassLibraryDirectory, plugin);
        }
Пример #4
0
        /// <summary>
        ///     Load a bass plug-in with a DLL path or directory.
        /// </summary>
        /// <param name="plugin">Plug-in type.</param>
        /// <param name="path">Plug-in DLL path or directory.</param>
        /// <returns>Bass plug-in object.</returns>
        public static Plugin LoadPlugin(BassPlugin plugin, string path)
        {
            if (File.Exists(path))
            {
                return new Plugin(path, plugin);
            }

            if (Directory.Exists(path))
            {
                var files = Directory.GetFiles(path, plugin.GetPluginName());

                if (files.Length != 0)
                {
                    return new Plugin(files[0], plugin);
                }
            }

            throw new BassPluginNotFoundException(BassManager.BassLibraryDirectory, plugin);
        }