2009-09-04 Zoltan Varga <vargaz@gmail.com>
[mcs.git] / class / System.ServiceModel / System.ServiceModel.Configuration / ExtensionsSection.cs
blob4e888ef038c95261d014063724c195057460d6f9
1 //
2 // ExtensionsSection.cs
3 //
4 // Author:
5 // Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // Copyright (C) 2006 Novell, Inc. http://www.novell.com
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 using System;
30 using System.Collections;
31 using System.Collections.Generic;
32 using System.Collections.ObjectModel;
33 using System.ComponentModel;
34 using System.Configuration;
35 using System.Net;
36 using System.Net.Security;
37 using System.Reflection;
38 using System.Security.Cryptography.X509Certificates;
39 using System.Security.Principal;
40 using System.IdentityModel.Claims;
41 using System.IdentityModel.Policy;
42 using System.IdentityModel.Tokens;
43 using System.ServiceModel;
44 using System.ServiceModel.Channels;
45 using System.ServiceModel.Description;
46 using System.ServiceModel.Diagnostics;
47 using System.ServiceModel.Dispatcher;
48 using System.ServiceModel.MsmqIntegration;
49 using System.ServiceModel.PeerResolvers;
50 using System.ServiceModel.Security;
51 using System.Runtime.Serialization;
52 using System.Text;
53 using System.Xml;
55 namespace System.ServiceModel.Configuration
57 public class ExtensionsSection
58 : ConfigurationSection
60 ConfigurationPropertyCollection _properties;
62 // Properties
64 [ConfigurationProperty ("behaviorExtensions",
65 Options = ConfigurationPropertyOptions.None)]
66 public ExtensionElementCollection BehaviorExtensions {
67 get { return (ExtensionElementCollection) base ["behaviorExtensions"]; }
70 [ConfigurationProperty ("bindingElementExtensions",
71 Options = ConfigurationPropertyOptions.None)]
72 public ExtensionElementCollection BindingElementExtensions {
73 get { return (ExtensionElementCollection) base ["bindingElementExtensions"]; }
76 [ConfigurationProperty ("bindingExtensions",
77 Options = ConfigurationPropertyOptions.None)]
78 public ExtensionElementCollection BindingExtensions {
79 get { return (ExtensionElementCollection) base ["bindingExtensions"]; }
82 protected override ConfigurationPropertyCollection Properties {
83 get {
84 if (_properties == null) {
85 _properties = new ConfigurationPropertyCollection ();
86 _properties.Add (new ConfigurationProperty ("behaviorExtensions", typeof (ExtensionElementCollection), null, null, null, ConfigurationPropertyOptions.None));
87 _properties.Add (new ConfigurationProperty ("bindingElementExtensions", typeof (ExtensionElementCollection), null, null, null, ConfigurationPropertyOptions.None));
88 _properties.Add (new ConfigurationProperty ("bindingExtensions", typeof (ExtensionElementCollection), null, null, null, ConfigurationPropertyOptions.None));
90 return _properties;
94 protected override void InitializeDefault () {
95 InitializeBehaviorExtensionsDefault ();
96 InitializeBindingElementExtensionsDefault ();
97 InitializeBindingExtensionsDefault ();
100 void InitializeBindingExtensionsDefault () {
101 BindingExtensions.Add (new ExtensionElement ("basicHttpBinding", typeof (BasicHttpBindingCollectionElement).AssemblyQualifiedName));
102 BindingExtensions.Add (new ExtensionElement ("customBinding", typeof (CustomBindingCollectionElement).AssemblyQualifiedName));
103 BindingExtensions.Add (new ExtensionElement ("mexHttpBinding", typeof (MexHttpBindingCollectionElement).AssemblyQualifiedName));
104 BindingExtensions.Add (new ExtensionElement ("mexHttpsBinding", typeof (MexHttpsBindingCollectionElement).AssemblyQualifiedName));
105 BindingExtensions.Add (new ExtensionElement ("mexNamedPipeBinding", typeof (MexNamedPipeBindingCollectionElement).AssemblyQualifiedName));
106 BindingExtensions.Add (new ExtensionElement ("mexTcpBinding", typeof (MexTcpBindingCollectionElement).AssemblyQualifiedName));
107 BindingExtensions.Add (new ExtensionElement ("msmqIntegrationBinding", typeof (MsmqIntegrationBindingCollectionElement).AssemblyQualifiedName));
108 BindingExtensions.Add (new ExtensionElement ("netMsmqBinding", typeof (NetMsmqBindingCollectionElement).AssemblyQualifiedName));
109 BindingExtensions.Add (new ExtensionElement ("netNamedPipeBinding", typeof (NetNamedPipeBindingCollectionElement).AssemblyQualifiedName));
110 BindingExtensions.Add (new ExtensionElement ("netPeerTcpBinding", typeof (NetPeerTcpBindingCollectionElement).AssemblyQualifiedName));
111 BindingExtensions.Add (new ExtensionElement ("netTcpBinding", typeof (NetTcpBindingCollectionElement).AssemblyQualifiedName));
112 BindingExtensions.Add (new ExtensionElement ("ws2007FederationHttpBinding", typeof (WS2007FederationHttpBindingCollectionElement).AssemblyQualifiedName));
113 BindingExtensions.Add (new ExtensionElement ("ws2007HttpBinding", typeof (WS2007HttpBindingCollectionElement).AssemblyQualifiedName));
114 BindingExtensions.Add (new ExtensionElement ("wsDualHttpBinding", typeof (WSDualHttpBindingCollectionElement).AssemblyQualifiedName));
115 BindingExtensions.Add (new ExtensionElement ("wsFederationHttpBinding", typeof (WSFederationHttpBindingCollectionElement).AssemblyQualifiedName));
116 BindingExtensions.Add (new ExtensionElement ("wsHttpBinding", typeof (WSHttpBindingCollectionElement).AssemblyQualifiedName));
119 void InitializeBindingElementExtensionsDefault () {
120 BindingElementExtensions.Add (new ExtensionElement ("binaryMessageEncoding", typeof (BinaryMessageEncodingElement).AssemblyQualifiedName));
121 BindingElementExtensions.Add (new ExtensionElement ("compositeDuplex", typeof (CompositeDuplexElement).AssemblyQualifiedName));
122 BindingElementExtensions.Add (new ExtensionElement ("httpTransport", typeof (HttpTransportElement).AssemblyQualifiedName));
123 BindingElementExtensions.Add (new ExtensionElement ("httpsTransport", typeof (HttpsTransportElement).AssemblyQualifiedName));
124 BindingElementExtensions.Add (new ExtensionElement ("msmqIntegration", typeof (MsmqIntegrationElement).AssemblyQualifiedName));
125 BindingElementExtensions.Add (new ExtensionElement ("msmqTransport", typeof (MsmqTransportElement).AssemblyQualifiedName));
126 BindingElementExtensions.Add (new ExtensionElement ("mtomMessageEncoding", typeof (MtomMessageEncodingElement).AssemblyQualifiedName));
127 BindingElementExtensions.Add (new ExtensionElement ("namedPipeTransport", typeof (NamedPipeTransportElement).AssemblyQualifiedName));
128 BindingElementExtensions.Add (new ExtensionElement ("oneWay", typeof (OneWayElement).AssemblyQualifiedName));
129 BindingElementExtensions.Add (new ExtensionElement ("peerTransport", typeof (PeerTransportElement).AssemblyQualifiedName));
130 BindingElementExtensions.Add (new ExtensionElement ("pnrpPeerResolver", typeof (PnrpPeerResolverElement).AssemblyQualifiedName));
131 BindingElementExtensions.Add (new ExtensionElement ("privacyNoticeAt", typeof (PrivacyNoticeElement).AssemblyQualifiedName));
132 BindingElementExtensions.Add (new ExtensionElement ("reliableSession", typeof (ReliableSessionElement).AssemblyQualifiedName));
133 BindingElementExtensions.Add (new ExtensionElement ("security", typeof (SecurityElement).AssemblyQualifiedName));
134 BindingElementExtensions.Add (new ExtensionElement ("sslStreamSecurity", typeof (SslStreamSecurityElement).AssemblyQualifiedName));
135 BindingElementExtensions.Add (new ExtensionElement ("tcpTransport", typeof (TcpTransportElement).AssemblyQualifiedName));
136 BindingElementExtensions.Add (new ExtensionElement ("textMessageEncoding", typeof (TextMessageEncodingElement).AssemblyQualifiedName));
137 BindingElementExtensions.Add (new ExtensionElement ("transactionFlow", typeof (TransactionFlowElement).AssemblyQualifiedName));
138 //BindingElementExtensions.Add (new ExtensionElement ("unrecognizedPolicyAssertion", typeof (UnrecognizedPolicyAssertionElement).AssemblyQualifiedName));
139 BindingElementExtensions.Add (new ExtensionElement ("useManagedPresentation", typeof (UseManagedPresentationElement).AssemblyQualifiedName));
140 BindingElementExtensions.Add (new ExtensionElement ("windowsStreamSecurity", typeof (WindowsStreamSecurityElement).AssemblyQualifiedName));
143 void InitializeBehaviorExtensionsDefault () {
144 BehaviorExtensions.Add (new ExtensionElement ("callbackDebug", typeof (CallbackDebugElement).AssemblyQualifiedName));
145 BehaviorExtensions.Add (new ExtensionElement ("callbackTimeouts", typeof (CallbackTimeoutsElement).AssemblyQualifiedName));
146 BehaviorExtensions.Add (new ExtensionElement ("clientCredentials", typeof (ClientCredentialsElement).AssemblyQualifiedName));
147 BehaviorExtensions.Add (new ExtensionElement ("clientVia", typeof (ClientViaElement).AssemblyQualifiedName));
148 BehaviorExtensions.Add (new ExtensionElement ("dataContractSerializer", typeof (DataContractSerializerElement).AssemblyQualifiedName));
149 BehaviorExtensions.Add (new ExtensionElement ("serviceAuthorization", typeof (ServiceAuthorizationElement).AssemblyQualifiedName));
150 BehaviorExtensions.Add (new ExtensionElement ("serviceCredentials", typeof (ServiceCredentialsElement).AssemblyQualifiedName));
151 BehaviorExtensions.Add (new ExtensionElement ("serviceDebug", typeof (ServiceDebugElement).AssemblyQualifiedName));
152 BehaviorExtensions.Add (new ExtensionElement ("serviceMetadata", typeof (ServiceMetadataPublishingElement).AssemblyQualifiedName));
153 BehaviorExtensions.Add (new ExtensionElement ("serviceSecurityAudit", typeof (ServiceSecurityAuditElement).AssemblyQualifiedName));
154 BehaviorExtensions.Add (new ExtensionElement ("serviceThrottling", typeof (ServiceThrottlingElement).AssemblyQualifiedName));
155 BehaviorExtensions.Add (new ExtensionElement ("serviceTimeouts", typeof (ServiceTimeoutsElement).AssemblyQualifiedName));
156 BehaviorExtensions.Add (new ExtensionElement ("synchronousReceive", typeof (SynchronousReceiveElement).AssemblyQualifiedName));
157 BehaviorExtensions.Add (new ExtensionElement ("transactedBatching", typeof (TransactedBatchingElement).AssemblyQualifiedName));