ServiceElementCollection.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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(ServiceElement), AddItemName = ConfigurationStrings.Service)]
  11. public sealed class ServiceElementCollection : ServiceModelEnhancedConfigurationElementCollection<ServiceElement>
  12. {
  13. public ServiceElementCollection()
  14. : base(ConfigurationStrings.Service)
  15. { }
  16. protected override Object GetElementKey(ConfigurationElement element)
  17. {
  18. if (element == null)
  19. {
  20. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element");
  21. }
  22. ServiceElement configElementKey = (ServiceElement)element;
  23. return configElementKey.Name;
  24. }
  25. }
  26. }