PolicyImporterElementCollection.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. using System.ServiceModel;
  11. using System.ServiceModel.Configuration;
  12. using System.ServiceModel.Channels;
  13. [ConfigurationCollection(typeof(PolicyImporterElement), AddItemName = ConfigurationStrings.Extension)]
  14. public sealed class PolicyImporterElementCollection : ServiceModelEnhancedConfigurationElementCollection<PolicyImporterElement>
  15. {
  16. public PolicyImporterElementCollection() : base(ConfigurationStrings.Extension)
  17. {
  18. }
  19. protected override Object GetElementKey(ConfigurationElement element)
  20. {
  21. if (element == null)
  22. {
  23. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element");
  24. }
  25. PolicyImporterElement configElementKey = (PolicyImporterElement)element;
  26. return configElementKey.Type;
  27. }
  28. internal void SetDefaults()
  29. {
  30. this.Add(new PolicyImporterElement(typeof(PrivacyNoticeBindingElementImporter)));
  31. this.Add(new PolicyImporterElement(typeof(UseManagedPresentationBindingElementImporter)));
  32. this.Add(new PolicyImporterElement(typeof(TransactionFlowBindingElementImporter)));
  33. this.Add(new PolicyImporterElement(typeof(ReliableSessionBindingElementImporter)));
  34. this.Add(new PolicyImporterElement(typeof(SecurityBindingElementImporter)));
  35. this.Add(new PolicyImporterElement(typeof(CompositeDuplexBindingElementImporter)));
  36. this.Add(new PolicyImporterElement(typeof(OneWayBindingElementImporter)));
  37. this.Add(new PolicyImporterElement(typeof(MessageEncodingBindingElementImporter)));
  38. this.Add(new PolicyImporterElement(typeof(TransportBindingElementImporter)));
  39. this.Add(new PolicyImporterElement(ConfigurationStrings.UdpTransportImporterType));
  40. }
  41. }
  42. }