CustomHandle.cs 1.5 KB

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