BasePane.cs 1001 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. namespace COM3D2.MeidoPhotoStudio.Plugin
  4. {
  5. internal abstract class BasePane
  6. {
  7. protected BaseWindow parent;
  8. protected List<BaseControl> Controls { get; set; }
  9. protected bool updating = false;
  10. public virtual bool Visible { get; set; }
  11. public virtual bool Enabled { get; set; }
  12. public BasePane()
  13. {
  14. Translation.ReloadTranslationEvent += OnReloadTranslation;
  15. Controls = new List<BaseControl>();
  16. }
  17. ~BasePane()
  18. {
  19. Translation.ReloadTranslationEvent -= OnReloadTranslation;
  20. }
  21. private void OnReloadTranslation(object sender, EventArgs args)
  22. {
  23. ReloadTranslation();
  24. }
  25. public void SetParent(BaseWindow window) => this.parent = window;
  26. protected virtual void ReloadTranslation() { }
  27. public virtual void UpdatePane() { }
  28. public virtual void Draw() { }
  29. }
  30. }