DelegatingHandlerElement.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // <copyright>
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. // </copyright>
  4. namespace System.ServiceModel.Configuration
  5. {
  6. using System;
  7. using System.Configuration;
  8. using System.Runtime;
  9. /// <summary>
  10. /// DelegatingHandlerElement for DelegatingHandler
  11. /// </summary>
  12. public sealed partial class DelegatingHandlerElement : ConfigurationElement
  13. {
  14. Guid id = Guid.NewGuid();
  15. public DelegatingHandlerElement()
  16. {
  17. }
  18. internal DelegatingHandlerElement(Type handlerType)
  19. {
  20. Fx.Assert(handlerType != null, "handlerType should not be null.");
  21. this.Type = handlerType.AssemblyQualifiedName;
  22. }
  23. [ConfigurationProperty(ConfigurationStrings.Type, Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
  24. [StringValidator(MinLength = 1)]
  25. public string Type
  26. {
  27. get
  28. {
  29. return (string)base[ConfigurationStrings.Type];
  30. }
  31. set
  32. {
  33. if (string.IsNullOrWhiteSpace(value))
  34. {
  35. value = string.Empty;
  36. }
  37. base[ConfigurationStrings.Type] = value;
  38. }
  39. }
  40. internal Guid Id
  41. {
  42. get
  43. {
  44. return this.id;
  45. }
  46. }
  47. }
  48. }