using System; using System.Collections.Generic; using zero.Core.Entities; namespace zero.Core.Options { public class ModuleOptions : ZeroBackofficeCollection, IZeroCollectionOptions { public ModuleOptions() { } public void Add(ModuleType moduleType) where T : Module, new() { Items.Add(ModuleType.Convert(moduleType)); } public void Add(string alias, string name, string description, string icon, string group = null, List tags = null, List disallowedPageTypes = null) where T : Module, new() { Items.Add(new ModuleType(typeof(T)) { Alias = alias, Name = name, Description = description, Icon = icon, Group = group, Tags = tags ?? new List(), DisallowedPageTypes = disallowedPageTypes ?? new List() }); } public void Add(Type type, string alias, string name, string description, string icon, string group = null, List tags = null, List disallowedPageTypes = null) { Items.Add(new ModuleType(type) { Alias = alias, Name = name, Description = description, Icon = icon, Group = group, Tags = tags ?? new List(), DisallowedPageTypes = disallowedPageTypes ?? new List() }); } } }