ComMethodElementCollection.cs 1.1 KB

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