private void LoadPlugin(IPluginModuleDescriptor plugin) { IPluginModule module = StudioContext.PluginManager.GetPluginModule(plugin.ID); if (module != null) { this.LoadPlugin(module, null); } }
/// <summary> /// Load all module instances in the <see cref="Modules"/> list. /// </summary> /// <param name="ownerType">Any type owned by the package.</param> public void LoadModules(Type ownerType) { // Get all modules foreach (Type type in ownerType.Assembly.GetExportedTypes()) { if (typeof(IPluginModuleDescriptor).IsAssignableFrom(type) && type.IsClass) { IPluginModuleDescriptor module = Activator.CreateInstance(type) as IPluginModuleDescriptor; this.Modules.Add(module); } } }