ConfigAttribute.cs 428 B

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