start page modules

This commit is contained in:
2022-01-12 18:49:36 +01:00
parent 25d1d47723
commit dfd8f9d17c
22 changed files with 1136 additions and 125 deletions
+3 -23
View File
@@ -2,12 +2,6 @@
public class PageModuleOptions : List<PageModuleType>
{
public void Add<T>(PageModuleType<T> moduleType) where T : PageModule, new()
{
Add(PageModuleType.Convert(moduleType));
}
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()
{
Add(new PageModuleType(typeof(T))
@@ -17,23 +11,9 @@ public class PageModuleOptions : List<PageModuleType>
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)
{
Add(new PageModuleType(type)
{
Alias = alias,
Name = name,
Description = description,
Icon = icon,
Group = group,
Tags = tags ?? new List<string>(),
DisallowedPageTypes = disallowedPageTypes ?? new List<string>()
Tags = tags ?? new(),
DisallowedPageTypes = disallowedPageTypes ?? new(),
Construct = _ => new T()
});
}
}