StaticLookupEditor.cs 770 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. namespace InABox.Core
  3. {
  4. public abstract class StaticLookupEditor : BaseEditor, ILookupEditor
  5. {
  6. public StaticLookupEditor(Type type)
  7. {
  8. Type = type;
  9. LookupWidth = int.MaxValue;
  10. }
  11. public Type Type { get; set; }
  12. public int LookupWidth { get; set; }
  13. public EditorButton[]? Buttons { get; set; }
  14. public abstract CoreTable Values(string columnname, object[]? items = null);
  15. public abstract void Clear();
  16. public StaticLookupEditor CloneStaticLookupEditor()
  17. {
  18. var result = (Activator.CreateInstance(GetType(), Type) as StaticLookupEditor)!;
  19. result.LookupWidth = LookupWidth;
  20. return result;
  21. }
  22. }
  23. }