Files
raven/server/AyaNova/DataList/DataListFactory.cs
2020-01-21 18:06:54 +00:00

41 lines
1.1 KiB
C#

using System.Collections.Generic;
using System.Linq;
namespace AyaNova.DataList
{
internal static class DataListFactory
{
internal static IAyaDataList GetAyaDataList(string ListKey)
{
switch (ListKey)
{
case nameof(TestWidgetUserEmailDataList):
return new TestWidgetUserEmailDataList();
default:
throw new System.ArgumentOutOfRangeException($"DataListFactory: Unknown list \"{ListKey}\"");
}
}
internal static List<string> GetListOfAllDataListKeyNames()
{
List<string> ret = new List<string>();
System.Reflection.Assembly ass = System.Reflection.Assembly.GetEntryAssembly();
foreach (System.Reflection.TypeInfo ti in ass.DefinedTypes)
{
if (ti.ImplementedInterfaces.Contains(typeof(IAyaDataList)))
{
ret.Add(ti.Name);
}
}
return ret;
}
}//eoc
}//eons