BaseAddressElement.cs 1.1 KB

123456789101112131415161718192021222324252627282930
  1. //------------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------------------------
  4. namespace System.ServiceModel.Configuration
  5. {
  6. using System.Configuration;
  7. public sealed partial class BaseAddressElement : ConfigurationElement
  8. {
  9. public BaseAddressElement() : base() { }
  10. // BaseAddress is exposed as a string instead of an Uri so that WCF can do
  11. // special parsing of wildcards (e.g. '*').
  12. [ConfigurationProperty(ConfigurationStrings.BaseAddress, Options = ConfigurationPropertyOptions.IsKey | ConfigurationPropertyOptions.IsRequired)]
  13. [StringValidator(MinLength = 1)]
  14. public string BaseAddress
  15. {
  16. get { return (string)base[ConfigurationStrings.BaseAddress]; }
  17. set
  18. {
  19. if (String.IsNullOrEmpty(value))
  20. {
  21. value = String.Empty;
  22. }
  23. base[ConfigurationStrings.BaseAddress] = value;
  24. }
  25. }
  26. }
  27. }