RemoveBehaviorElement.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 RemoveBehaviorElement : BehaviorExtensionElement
  8. {
  9. public RemoveBehaviorElement() { }
  10. [ConfigurationProperty(ConfigurationStrings.Name, Options = ConfigurationPropertyOptions.IsRequired)]
  11. [StringValidator(MinLength = 1)]
  12. public string Name
  13. {
  14. get { return (string)base[ConfigurationStrings.Name]; }
  15. set { base[ConfigurationStrings.Name] = value; }
  16. }
  17. public override void CopyFrom(ServiceModelExtensionElement from)
  18. {
  19. base.CopyFrom(from);
  20. RemoveBehaviorElement source = (RemoveBehaviorElement) from;
  21. #pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null
  22. this.Name = source.Name;
  23. }
  24. protected internal override object CreateBehavior()
  25. {
  26. return null;
  27. }
  28. public override Type BehaviorType
  29. {
  30. get { return null; }
  31. }
  32. }
  33. }