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