public void Load() { foreach (string s in System.IO.Directory.GetFiles(string.Format("Plugins/{0}", SourceDirectory))) { Plugin plugin = new Plugin(this, System.IO.Path.GetFileNameWithoutExtension(s), File.ReadAllText(s)); Plugins.Add(plugin); if (OnLoad != null) OnLoad(plugin); } }
static void pluginmanager_OnLoad(Plugin _LoadedPlugin) { foreach (Type t in _LoadedPlugin.Types) { if (t.BaseType == typeof(Converter)) { Converter converter = (Converter)_LoadedPlugin.CreateInstance(t.FullName); if (converter != null) { AddConverter(converter, converter.Converts); } } } }
static void pluginmanager_OnLoad(Plugin _LoadedPlugin) { }