42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using AyaNova.Biz;
|
|
using AyaNova.Models;
|
|
|
|
|
|
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 PickList-able object types available
|
|
internal static List<NameIdItem> GetListOfAllPickListKeyNames()
|
|
{
|
|
|
|
List<NameIdItem> ret = new List<NameIdItem>();
|
|
var values = System.Enum.GetValues(typeof(AyaType));
|
|
foreach (AyaType t in values)
|
|
{
|
|
if (t.HasAttribute(typeof(CoreBizObjectAttribute)))
|
|
{
|
|
ret.Add(new NameIdItem() { Name = t.ToString(), Id = (long)t });
|
|
}
|
|
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
|
|
}//eoc
|
|
}//eons |