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>(PageModuleType<T> moduleType) where T : PageModule, new()
|
2021-11-19 14:59:24 +01:00
|
|
|
{
|
2021-11-24 15:49:25 +01:00
|
|
|
Add(PageModuleType.Convert(moduleType));
|
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,
|
|
|
|
|
Tags = tags ?? new List<string>(),
|
|
|
|
|
DisallowedPageTypes = disallowedPageTypes ?? new List<string>()
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Add(Type type, string alias, string name, string description, string icon, string group = null, List<string> tags = null, List<string> disallowedPageTypes = null)
|
|
|
|
|
{
|
2021-11-24 15:49:25 +01:00
|
|
|
Add(new PageModuleType(type)
|
2021-11-19 14:59:24 +01:00
|
|
|
{
|
|
|
|
|
Alias = alias,
|
|
|
|
|
Name = name,
|
|
|
|
|
Description = description,
|
|
|
|
|
Icon = icon,
|
|
|
|
|
Group = group,
|
|
|
|
|
Tags = tags ?? new List<string>(),
|
|
|
|
|
DisallowedPageTypes = disallowedPageTypes ?? new List<string>()
|
|
|
|
|
});
|
|
|
|
|
}
|
2021-11-24 15:49:25 +01:00
|
|
|
}
|