public async Task AddPluginAsync(ICheckMailParams checkMailParamsPlugin) { this.Logger.LogInfo("Initializes CheckMailParamsPlugin \"" + checkMailParamsPlugin.GetType().FullName + "\"."); if (checkMailParamsPlugin is IInitializable initializable) { await initializable.InitializeAsync(); } CheckMailParamsCollection collection; if (this.plugins.ContainsKey(typeof(ICheckMailParams))) { collection = (CheckMailParamsCollection)this.plugins[typeof(ICheckMailParams)]; } else { this.plugins.Add(typeof(ICheckMailParams), collection = new CheckMailParamsCollection()); } collection.Add(checkMailParamsPlugin); this.Logger.LogInfo("Plugin \"" + checkMailParamsPlugin.GetType().FullName + "\" ready to use."); }
public void Add(ICheckMailParams plugin) { this.allPlugins.Add(plugin); }