CustomHandle.cs 1.4 KB

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