DynamicEditorPage.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Collections.Concurrent;
  3. using System.Collections.Generic;
  4. using System.Windows;
  5. using InABox.Core;
  6. namespace InABox.DynamicGrid;
  7. public enum PageType
  8. {
  9. Editor,
  10. Other
  11. }
  12. public interface IDynamicEditorPage
  13. {
  14. DynamicEditorGrid EditorGrid { get; set; }
  15. PageType PageType { get; }
  16. bool Ready { get; set; }
  17. bool ReadOnly { get; set; }
  18. void Load(object item, Func<Type, CoreTable?>? PageDataHandler);
  19. void BeforeSave(object item);
  20. void AfterSave(object item);
  21. event EventHandler OnChanged;
  22. void DoChanged();
  23. Size MinimumSize();
  24. string Caption();
  25. int Order();
  26. }
  27. //public class DynamicEditorPage
  28. //{
  29. // public String Name { get; set; }
  30. // public Control Page { get; set; }
  31. // public DynamicEditorPage(String name, Control page) : base()
  32. // {
  33. // Name = name;
  34. // Page = page;
  35. // }
  36. //}
  37. public class DynamicEditorPages : List<IDynamicEditorPage>
  38. {
  39. public DynamicEditorPages() : base()
  40. {
  41. }
  42. public DynamicEditorPages(IEnumerable<IDynamicEditorPage> pages) : this()
  43. {
  44. foreach (var page in pages)
  45. Add(page);
  46. }
  47. }