WsdlImporterElementCollection.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //------------------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. //------------------------------------------------------------------------------
  4. namespace System.ServiceModel.Configuration
  5. {
  6. using System;
  7. using System.ServiceModel.Description;
  8. using System.Collections;
  9. using System.Configuration;
  10. using System.Globalization;
  11. using System.ServiceModel;
  12. using System.ServiceModel.Configuration;
  13. using System.ServiceModel.Channels;
  14. [ConfigurationCollection(typeof(WsdlImporterElement), AddItemName = ConfigurationStrings.Extension)]
  15. public sealed class WsdlImporterElementCollection : ServiceModelEnhancedConfigurationElementCollection<WsdlImporterElement>
  16. {
  17. public WsdlImporterElementCollection() : base(ConfigurationStrings.Extension)
  18. {
  19. }
  20. protected override Object GetElementKey(ConfigurationElement element)
  21. {
  22. if (element == null)
  23. {
  24. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element");
  25. }
  26. WsdlImporterElement configElementKey = (WsdlImporterElement)element;
  27. return configElementKey.Type;
  28. }
  29. internal void SetDefaults()
  30. {
  31. this.Add(new WsdlImporterElement(typeof(DataContractSerializerMessageContractImporter)));
  32. this.Add(new WsdlImporterElement(typeof(XmlSerializerMessageContractImporter)));
  33. this.Add(new WsdlImporterElement(typeof(MessageEncodingBindingElementImporter)));
  34. this.Add(new WsdlImporterElement(typeof(TransportBindingElementImporter)));
  35. this.Add(new WsdlImporterElement(typeof(StandardBindingImporter)));
  36. this.Add(new WsdlImporterElement(ConfigurationStrings.UdpTransportImporterType));
  37. }
  38. }
  39. }