AEventAttribute.cs 527 B

123456789101112131415161718192021222324252627
  1. using System;
  2. namespace Model
  3. {
  4. [AttributeUsage(AttributeTargets.Class)]
  5. public abstract class AEventAttribute: Attribute
  6. {
  7. public EventType Type { get; private set; }
  8. private ServerType ServerType { get; set; }
  9. protected AEventAttribute(EventType type, ServerType serverType)
  10. {
  11. this.Type = type;
  12. this.ServerType = serverType;
  13. }
  14. public bool Contains(ServerType serverType)
  15. {
  16. if ((this.ServerType & serverType) == 0)
  17. {
  18. return false;
  19. }
  20. return true;
  21. }
  22. }
  23. }