using InABox.Core; using System.Collections.Generic; using System.Linq; using System.Text; using InABox.Clients; namespace Comal.Classes { public class DataEntryTagLookupGenerator : LookupGenerator { public DataEntryTagLookupGenerator(object[] items) : base(items) { var classes = CoreUtils.Entities .Where(x => x.IsSubclassOf(typeof(Entity)) && CoreUtils.HasInterface(x) && x.GetInterfaces().Contains(typeof(IPersistent))) .OrderBy(x => x.EntityName().Split('.').Last()).ToArray(); foreach (var entity in classes) if (ClientFactory.IsSupported(entity)) AddValue(entity.EntityName(), entity.GetCaption()); } } public class DataEntryTag : Entity, IDataEntryTag, IRemotable, IPersistent, ILicense { [EditorSequence(1)] [TextBoxEditor] public string Name { get; set; } = ""; [EditorSequence(2)] [ComboLookupEditor(typeof(DataEntryTagLookupGenerator), Visible = Visible.Default)] public string AppliesTo { get; set; } = ""; } }