BasePane.cs 933 B

1234567891011121314151617181920212223242526272829303132
  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;
  10. public virtual bool Visible { get; set; }
  11. public virtual bool Enabled { get; set; }
  12. protected BasePane()
  13. {
  14. Translation.ReloadTranslationEvent += OnReloadTranslation;
  15. Controls = new List<BaseControl>();
  16. }
  17. ~BasePane() => Translation.ReloadTranslationEvent -= OnReloadTranslation;
  18. private void OnReloadTranslation(object sender, EventArgs args) => ReloadTranslation();
  19. public void SetParent(BaseWindow window) => parent = window;
  20. protected virtual void ReloadTranslation() { }
  21. public virtual void UpdatePane() { }
  22. public virtual void Draw() { }
  23. }
  24. }