ChannelEndpointElementCollection.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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(ChannelEndpointElement), AddItemName = ConfigurationStrings.Endpoint)]
  11. public sealed class ChannelEndpointElementCollection : ServiceModelEnhancedConfigurationElementCollection<ChannelEndpointElement>
  12. {
  13. public ChannelEndpointElementCollection()
  14. : base(ConfigurationStrings.Endpoint)
  15. { }
  16. protected override Object GetElementKey(ConfigurationElement element)
  17. {
  18. if (element == null)
  19. {
  20. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element");
  21. }
  22. ChannelEndpointElement configElementKey = (ChannelEndpointElement)element;
  23. return string.Format(CultureInfo.InvariantCulture,
  24. "contractType:{0};name:{1}",
  25. configElementKey.Contract,
  26. configElementKey.Name);
  27. }
  28. }
  29. }