123456789101112131415161718192021222324252627282930313233 |
- using InABox.Core;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using InABox.Clients;
- namespace Comal.Classes
- {
-
- public class DataEntryTagLookupGenerator : LookupGenerator<object>
- {
- public DataEntryTagLookupGenerator(object[] items) : base(items)
- {
- var classes = CoreUtils.Entities
- .Where(x => x.IsSubclassOf(typeof(Entity)) && CoreUtils.HasInterface<IDataEntryInstance>(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<DataEntryLicense>
- {
- [EditorSequence(1)]
- [TextBoxEditor]
- public string Name { get; set; } = "";
- [EditorSequence(2)]
- [ComboLookupEditor(typeof(DataEntryTagLookupGenerator), Visible = Visible.Default)]
- public string AppliesTo { get; set; } = "";
- }
- }
|