using System.Collections.Generic; using System.Linq; using AyaNova.Biz; namespace AyaNova.PickList { internal static class PickListFactory { //Instantiate list object specified from type internal static IAyaPickList GetAyaPickList(AyaType ayaType) { switch (ayaType) { case AyaType.Widget: return new WidgetPickList() as IAyaPickList; } return null; } //List all the datalist types available internal static List GetListOfAllPickListKeyNames() { //https://stackoverflow.com/a/42574373/8939 List ret = new List(); System.Reflection.Assembly ass = System.Reflection.Assembly.GetEntryAssembly(); foreach (System.Reflection.TypeInfo ti in ass.DefinedTypes) { if (!ti.IsAbstract && ti.ImplementedInterfaces.Contains(typeof(IAyaPickList))) { ret.Add(ti.Name); } } return ret; } }//eoc }//eons