WizardPageElementBase.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace TheraBytes.BetterUi.Editor
  6. {
  7. public abstract class WizardPageElementBase
  8. {
  9. protected bool markCompleteImmediately;
  10. public WizardElementState State { get; protected set; }
  11. public abstract void DrawGui();
  12. public WizardPageElementBase Activate()
  13. {
  14. if(markCompleteImmediately)
  15. {
  16. State = WizardElementState.Complete;
  17. return this;
  18. }
  19. State = WizardElementState.WaitForInput;
  20. return this;
  21. }
  22. public WizardPageElementBase MarkComplete()
  23. {
  24. if(State == WizardElementState.Pending)
  25. {
  26. markCompleteImmediately = true;
  27. return this;
  28. }
  29. State = WizardElementState.Complete;
  30. return this;
  31. }
  32. }
  33. public enum WizardElementState
  34. {
  35. Pending,
  36. WaitForInput,
  37. Complete,
  38. }
  39. }