Ref parameter was not covered by ParameterInfo.IsOut. Fixed bug #696784.
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.Configuration / NetNamedPipeBindingElement.cs
1 //
2 // NetNamedPipeBindingElement.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.
27 //
28
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;
54
55 namespace System.ServiceModel.Configuration
56 {
57         public partial class NetNamedPipeBindingElement
58                  : StandardBindingElement,  IBindingConfigurationElement
59         {
60                 ConfigurationPropertyCollection _properties;
61
62                 public NetNamedPipeBindingElement ()
63                 {
64                 }
65
66                 public NetNamedPipeBindingElement (string name) : base (name) { }
67
68                 // Properties
69
70                 protected override Type BindingElementType {
71                         get { return typeof (NetNamedPipeBinding); }
72                 }
73
74                 [ConfigurationProperty ("hostNameComparisonMode",
75                          Options = ConfigurationPropertyOptions.None,
76                          DefaultValue = "StrongWildcard")]
77                 public HostNameComparisonMode HostNameComparisonMode {
78                         get { return (HostNameComparisonMode) this ["hostNameComparisonMode"]; }
79                         set { this ["hostNameComparisonMode"] = value; }
80                 }
81
82                 [ConfigurationProperty ("maxBufferPoolSize",
83                          Options = ConfigurationPropertyOptions.None,
84                          DefaultValue = "524288")]
85                 [LongValidator ( MinValue = 0,
86                          MaxValue = 9223372036854775807,
87                         ExcludeRange = false)]
88                 public long MaxBufferPoolSize {
89                         get { return (long) this ["maxBufferPoolSize"]; }
90                         set { this ["maxBufferPoolSize"] = value; }
91                 }
92
93                 [ConfigurationProperty ("maxBufferSize",
94                          Options = ConfigurationPropertyOptions.None,
95                          DefaultValue = "65536")]
96                 [IntegerValidator ( MinValue = 1,
97                         MaxValue = int.MaxValue,
98                         ExcludeRange = false)]
99                 public int MaxBufferSize {
100                         get { return (int) this ["maxBufferSize"]; }
101                         set { this ["maxBufferSize"] = value; }
102                 }
103
104                 [IntegerValidator ( MinValue = 1,
105                         MaxValue = int.MaxValue,
106                         ExcludeRange = false)]
107                 [ConfigurationProperty ("maxConnections",
108                          Options = ConfigurationPropertyOptions.None,
109                          DefaultValue = "10")]
110                 public int MaxConnections {
111                         get { return (int) this ["maxConnections"]; }
112                         set { this ["maxConnections"] = value; }
113                 }
114
115                 [ConfigurationProperty ("maxReceivedMessageSize",
116                          Options = ConfigurationPropertyOptions.None,
117                          DefaultValue = "65536")]
118                 [LongValidator ( MinValue = 1,
119                          MaxValue = 9223372036854775807,
120                         ExcludeRange = false)]
121                 public long MaxReceivedMessageSize {
122                         get { return (long) this ["maxReceivedMessageSize"]; }
123                         set { this ["maxReceivedMessageSize"] = value; }
124                 }
125
126                 protected override ConfigurationPropertyCollection Properties {
127                         get {
128                                 if (_properties == null) {
129                                         _properties = base.Properties;
130                                         _properties.Add (new ConfigurationProperty ("hostNameComparisonMode", typeof (HostNameComparisonMode), "StrongWildcard", null, null, ConfigurationPropertyOptions.None));
131                                         _properties.Add (new ConfigurationProperty ("maxBufferPoolSize", typeof (long), "524288", null, null, ConfigurationPropertyOptions.None));
132                                         _properties.Add (new ConfigurationProperty ("maxBufferSize", typeof (int), "65536", null, null, ConfigurationPropertyOptions.None));
133                                         _properties.Add (new ConfigurationProperty ("maxConnections", typeof (int), "10", null, null, ConfigurationPropertyOptions.None));
134                                         _properties.Add (new ConfigurationProperty ("maxReceivedMessageSize", typeof (long), "65536", null, null, ConfigurationPropertyOptions.None));
135                                         _properties.Add (new ConfigurationProperty ("readerQuotas", typeof (XmlDictionaryReaderQuotasElement), null, null, null, ConfigurationPropertyOptions.None));
136                                         _properties.Add (new ConfigurationProperty ("security", typeof (NetNamedPipeSecurityElement), null, null, null, ConfigurationPropertyOptions.None));
137                                         _properties.Add (new ConfigurationProperty ("transactionFlow", typeof (bool), "false", new BooleanConverter (), null, ConfigurationPropertyOptions.None));
138                                         _properties.Add (new ConfigurationProperty ("transactionProtocol", typeof (TransactionProtocol), "OleTransactions", TransactionProtocolConverter.Instance, null, ConfigurationPropertyOptions.None));
139                                         _properties.Add (new ConfigurationProperty ("transferMode", typeof (TransferMode), "Buffered", null, null, ConfigurationPropertyOptions.None));
140                                 }
141                                 return _properties;
142                         }
143                 }
144
145                 [ConfigurationProperty ("readerQuotas",
146                          Options = ConfigurationPropertyOptions.None)]
147                 public XmlDictionaryReaderQuotasElement ReaderQuotas {
148                         get { return (XmlDictionaryReaderQuotasElement) this ["readerQuotas"]; }
149                 }
150
151                 [ConfigurationProperty ("security",
152                          Options = ConfigurationPropertyOptions.None)]
153                 public NetNamedPipeSecurityElement Security {
154                         get { return (NetNamedPipeSecurityElement) this ["security"]; }
155                 }
156
157                 [ConfigurationProperty ("transactionFlow",
158                          Options = ConfigurationPropertyOptions.None,
159                         DefaultValue = false)]
160                 public bool TransactionFlow {
161                         get { return (bool) this ["transactionFlow"]; }
162                         set { this ["transactionFlow"] = value; }
163                 }
164
165                 [ConfigurationProperty ("transactionProtocol",
166                          Options = ConfigurationPropertyOptions.None,
167                          DefaultValue = "OleTransactions")]
168                 [TypeConverter (typeof (TransactionProtocolConverter))]
169                 public TransactionProtocol TransactionProtocol {
170                         get { return (TransactionProtocol) this ["transactionProtocol"]; }
171                         set { this ["transactionProtocol"] = value; }
172                 }
173
174                 [ConfigurationProperty ("transferMode",
175                          Options = ConfigurationPropertyOptions.None,
176                          DefaultValue = "Buffered")]
177                 public TransferMode TransferMode {
178                         get { return (TransferMode) this ["transferMode"]; }
179                         set { this ["transferMode"] = value; }
180                 }
181
182
183
184                 protected override void OnApplyConfiguration (Binding binding) {
185                         throw new NotImplementedException ();
186                 }
187         }
188
189 }