40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
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 IAyaDataList;
|
|
}
|
|
}
|
|
|
|
//List all the datalist types available
|
|
internal static List<string> GetListOfAllPickListKeyNames()
|
|
{
|
|
//https://stackoverflow.com/a/42574373/8939
|
|
|
|
List<string> ret = new List<string>();
|
|
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 |