ServiceActivationElementCollection.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //------------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------------------------
  4. namespace System.ServiceModel.Configuration
  5. {
  6. using System;
  7. using System.Collections;
  8. using System.Configuration;
  9. using System.Globalization;
  10. [ConfigurationCollection(typeof(ServiceActivationElement))]
  11. public sealed class ServiceActivationElementCollection : ServiceModelConfigurationElementCollection<ServiceActivationElement>
  12. {
  13. public ServiceActivationElementCollection()
  14. : base(ConfigurationElementCollectionType.AddRemoveClearMap, ConfigurationStrings.Add)
  15. {
  16. }
  17. protected override ConfigurationElement CreateNewElement()
  18. {
  19. return new ServiceActivationElement();
  20. }
  21. protected override Object GetElementKey(ConfigurationElement element)
  22. {
  23. if (element == null)
  24. {
  25. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element");
  26. }
  27. ServiceActivationElement configElementKey = (ServiceActivationElement)element;
  28. return configElementKey.RelativeAddress;
  29. }
  30. protected override bool ThrowOnDuplicate
  31. {
  32. get { return true; }
  33. }
  34. }
  35. }