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 Caption { get; set; }
  12. public Bitmap Image { get; set; }
  13. public void Execute()
  14. {
  15. OnExecute?.Invoke(this);
  16. }
  17. }
  18. public interface ICorePanel
  19. {
  20. void Setup();
  21. void Shutdown();
  22. void Refresh();
  23. }
  24. public interface IBasePanel : ICorePanel, IDataModelSource
  25. {
  26. bool IsReady { get; set; }
  27. void CreateToolbarButtons(IPanelHost host);
  28. Dictionary<string, object[]> Selected();
  29. void Heartbeat(TimeSpan time);
  30. }
  31. public interface IPanel<T> : IBasePanel
  32. {
  33. }
  34. public interface IPropertiesPanel<TProperties>
  35. where TProperties : BaseObject, IGlobalConfigurationSettings, new()
  36. {
  37. public TProperties Properties { get; set; }
  38. }
  39. public interface IPanelHost
  40. {
  41. void CreatePanelAction(PanelAction action);
  42. void CreateSetupAction(PanelAction action);
  43. }
  44. }