ServiceModelEnumValidatorAttribute.cs 967 B

12345678910111213141516171819202122232425262728293031
  1. //------------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------------------------
  4. namespace System.ServiceModel.Configuration
  5. {
  6. using System;
  7. using System.Configuration;
  8. [AttributeUsage(AttributeTargets.Property)]
  9. internal sealed class ServiceModelEnumValidatorAttribute : ConfigurationValidatorAttribute
  10. {
  11. Type enumHelperType;
  12. public ServiceModelEnumValidatorAttribute(Type enumHelperType)
  13. {
  14. this.EnumHelperType = enumHelperType;
  15. }
  16. public Type EnumHelperType
  17. {
  18. get { return this.enumHelperType; }
  19. set { this.enumHelperType = value; }
  20. }
  21. public override ConfigurationValidatorBase ValidatorInstance
  22. {
  23. get { return new ServiceModelEnumValidator(enumHelperType); }
  24. }
  25. }
  26. }