public virtual void UnloadPlugins() { foreach (var plugin in _repository.PluginsByType) { // Close all plugin instances // We call the plugins Dispose sub first incase it has to do // Its own cleanup stuff plugin.UnloadPlugin(); } // Finally, clear our collection of available plugins _repository.Clear(); }