CustomBindingElementCollection.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. //------------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------------------------
  4. namespace System.ServiceModel.Configuration
  5. {
  6. using System;
  7. using System.ServiceModel.Channels;
  8. using System.Collections;
  9. using System.Configuration;
  10. using System.Globalization;
  11. [ConfigurationCollection(typeof(CustomBindingElement), AddItemName = ConfigurationStrings.Binding)]
  12. public sealed class CustomBindingElementCollection : ServiceModelEnhancedConfigurationElementCollection<CustomBindingElement>
  13. {
  14. public CustomBindingElementCollection()
  15. : base(ConfigurationStrings.Binding)
  16. { }
  17. protected override Object GetElementKey(ConfigurationElement element)
  18. {
  19. if (element == null)
  20. {
  21. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element");
  22. }
  23. CustomBindingElement configElementKey = (CustomBindingElement)element;
  24. return configElementKey.Name;
  25. }
  26. }
  27. }