DarkRift.Server.PluginFactory.AddDirectory C# (CSharp) Method

AddDirectory() private method

Adds a directory of plugin files to the index.
private AddDirectory ( string directory, bool create, DependencyResolutionStrategy dependencyResolutionStrategy ) : void
directory string The directory to add.
create bool Whether to create the directory if not present.
dependencyResolutionStrategy DependencyResolutionStrategy The way to resolve dependencies for the plugin.
return void
        internal void AddDirectory(string directory, bool create, DependencyResolutionStrategy dependencyResolutionStrategy)
        {
            //Create plugin directory if not present
            if (Directory.Exists(directory))
            {
                //Get the names of all files to try and load
                string[] pluginSourceFiles = Directory.GetFiles(directory, "*.dll", SearchOption.AllDirectories);

                AddFiles(pluginSourceFiles, dependencyResolutionStrategy, directory);
            }
            else
            {
                if (create)
                    Directory.CreateDirectory(directory);
            }
        }