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 GetListOfAllDataListKeyNames() { List ret = new List(); 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