Files
mixtape/zero.Core/Pages/Modules/PageModuleOptions.cs
T

19 lines
570 B
C#
Raw Normal View History

2021-11-24 15:49:25 +01:00
namespace zero.Pages;
2021-11-19 14:59:24 +01:00
2021-11-24 15:49:25 +01:00
public class PageModuleOptions : List<PageModuleType>
2021-11-19 14:59:24 +01:00
{
2021-11-24 15:49:25 +01:00
public void Add<T>(string alias, string name, string description, string icon, string group = null, List<string> tags = null, List<string> disallowedPageTypes = null) where T : PageModule, new()
2021-11-19 14:59:24 +01:00
{
2021-11-24 15:49:25 +01:00
Add(new PageModuleType(typeof(T))
2021-11-19 14:59:24 +01:00
{
Alias = alias,
Name = name,
Description = description,
Icon = icon,
Group = group,
2022-01-12 18:49:36 +01:00
Tags = tags ?? new(),
DisallowedPageTypes = disallowedPageTypes ?? new(),
Construct = _ => new T()
2021-11-19 14:59:24 +01:00
});
}
2021-11-24 15:49:25 +01:00
}