This commit is contained in:
2020-03-12 22:36:20 +00:00
parent e0b5ea0dc3
commit 883e10fcd7
10 changed files with 239 additions and 142 deletions

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using AyaNova.Biz;
using AyaNova.Models;
namespace AyaNova.PickList
@@ -19,20 +20,19 @@ namespace AyaNova.PickList
return null;
}
//List all the datalist types available
internal static List<string> GetListOfAllPickListKeyNames()
{
//https://stackoverflow.com/a/42574373/8939
//List all the PickList-able object types available
internal static List<NameIdItem> GetListOfAllPickListKeyNames()
{
List<string> ret = new List<string>();
System.Reflection.Assembly ass = System.Reflection.Assembly.GetEntryAssembly();
foreach (System.Reflection.TypeInfo ti in ass.DefinedTypes)
List<NameIdItem> ret = new List<NameIdItem>();
var values = System.Enum.GetValues(typeof(AyaType));
foreach (AyaType t in values)
{
if (!ti.IsAbstract && ti.ImplementedInterfaces.Contains(typeof(IAyaPickList)))
if (t.HasAttribute(typeof(CoreBizObjectAttribute)))
{
ret.Add(ti.Name);
ret.Add(new NameIdItem() { Name = t.ToString(), Id = (long)t });
}
}
return ret;
}