IPanel.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using InABox.Configuration;
  5. using InABox.Core;
  6. namespace PRSDesktop
  7. {
  8. public class PanelAction
  9. {
  10. public Action<PanelAction> OnExecute { get; set; }
  11. public string Section { get; set; }
  12. public string Caption { get; set; }
  13. public Bitmap Image { get; set; }
  14. public void Execute()
  15. {
  16. OnExecute?.Invoke(this);
  17. }
  18. }
  19. public interface ICorePanel
  20. {
  21. void Setup();
  22. void Shutdown();
  23. void Refresh();
  24. }
  25. public interface IBasePanel : ICorePanel, IDataModelSource
  26. {
  27. bool IsReady { get; set; }
  28. void CreateToolbarButtons(IPanelHost host);
  29. Dictionary<string, object[]> Selected();
  30. void Heartbeat(TimeSpan time);
  31. }
  32. public interface IPanel<T> : IBasePanel
  33. {
  34. }
  35. public interface IPropertiesPanel<TProperties>
  36. where TProperties : BaseObject, GlobalConfigurationSettings, new()
  37. {
  38. public TProperties Properties { get; set; }
  39. }
  40. public interface IPanelHost
  41. {
  42. void CreatePanelAction(PanelAction action);
  43. }
  44. }