ComponentHandlerAttribute.cs 738 B

1234567891011121314151617181920212223242526
  1. using System;
  2. namespace XCharts.Runtime
  3. {
  4. [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
  5. public sealed class ComponentHandlerAttribute : Attribute
  6. {
  7. public readonly Type handler;
  8. public readonly bool allowMultiple = true;
  9. public readonly int order = 3;
  10. public ComponentHandlerAttribute(Type handler, int order = 3)
  11. {
  12. this.handler = handler;
  13. this.allowMultiple = true;
  14. this.order = order;
  15. }
  16. public ComponentHandlerAttribute(Type handler, bool allowMultiple, int order = 3)
  17. {
  18. this.handler = handler;
  19. this.allowMultiple = allowMultiple;
  20. this.order = order;
  21. }
  22. }
  23. }