InspectableObjectBase.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace BansheeEngine
  6. {
  7. public abstract class InspectableObjectBase
  8. {
  9. private bool _isExpanded = false;
  10. private InspectableField[] _fields;
  11. public bool isExpanded { get { return _isExpanded; } }
  12. public InspectableField[] fields { get { return _fields; } }
  13. public void Expand()
  14. {
  15. // TODO - Show all child "fields"
  16. // Reposition all visual child elements
  17. // Re-do tab indexes
  18. _isExpanded = true;
  19. }
  20. public void Collapse()
  21. {
  22. // TODO - Hide all child "fields"
  23. // Reposition all visual child elements
  24. // Re-do tab indexes
  25. _isExpanded = false;
  26. }
  27. public void Refresh()
  28. {
  29. for (int i = 0; i < fields.Length; i++)
  30. fields[i].Refresh();
  31. }
  32. public void Destroy()
  33. {
  34. for (int i = 0; i < fields.Length; i++)
  35. fields[i].Destroy();
  36. }
  37. }
  38. }