DynamicEditorPage.cs 1.3 KB

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