BasePane.cs 945 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. namespace MeidoPhotoStudio.Plugin;
  3. public abstract class BasePane
  4. {
  5. protected BaseWindow parent;
  6. protected bool updating;
  7. protected BasePane() =>
  8. Translation.ReloadTranslationEvent += OnReloadTranslation;
  9. // TODO: This does not work how I think it works. Probably just remove entirely.
  10. ~BasePane() =>
  11. Translation.ReloadTranslationEvent -= OnReloadTranslation;
  12. public virtual bool Visible { get; set; }
  13. public virtual bool Enabled { get; set; }
  14. public virtual void SetParent(BaseWindow window) =>
  15. parent = window;
  16. public virtual void UpdatePane()
  17. {
  18. }
  19. public virtual void Draw()
  20. {
  21. }
  22. public virtual void Activate()
  23. {
  24. }
  25. public virtual void Deactivate()
  26. {
  27. }
  28. protected virtual void ReloadTranslation()
  29. {
  30. }
  31. private void OnReloadTranslation(object sender, EventArgs args) =>
  32. ReloadTranslation();
  33. }