| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- 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.EntityName().Split('.').Last());
- }
- }
-
- 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; }
- protected override void Init()
- {
- base.Init();
- Name = "";
- AppliesTo = "";
- }
- }
- }
|