CustomHandle.cs 1.2 KB

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using BansheeEngine;
  3. namespace BansheeEditor
  4. {
  5. /// <summary>
  6. /// Attribute that can be added to types deriving from <see cref="BansheeEditor.Handle"/>. That handle implementation
  7. /// will then be used whenever a handle for the type specified in this attribute needs to be displayed.
  8. ///
  9. /// Implementation must contain a constructor accepting the object for the type the handle is shown for, otherwise
  10. /// it will not be recognized by the system. If handle is not shown for any specific type, the constructor should not
  11. /// accept any parameters.
  12. /// </summary>
  13. [AttributeUsage(AttributeTargets.Class)]
  14. public sealed class CustomHandle : Attribute
  15. {
  16. private Type type;
  17. /// <summary>
  18. /// Creates a new custom handle attribute.
  19. /// </summary>
  20. /// <param name="type">Type deriving from <see cref="Component"/> for which the custom handle will be displayed.
  21. /// Type can be null in which case the handle is always displayed.</param>
  22. public CustomHandle(Type type)
  23. {
  24. this.type = type;
  25. }
  26. }
  27. }