* BinaryServerFormatterSink.cs: Fixed argument name to match MS.
[mono.git] / mcs / class / System.Runtime.Remoting / System.Runtime.Remoting.Channels / BinaryClientFormatterSinkProvider.cs
index be81cab2e4119e558ee427544e43d60c918236c9..64482b84f2e4b06c58919d014e9c86b48059614c 100644 (file)
@@ -2,10 +2,32 @@
 // System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider.cs
 //
 // Author: Rodrigo Moya (rodrigo@ximian.com)
+//         Lluis Sanchez Gual (lluis@ximian.com)
 //
 // 2002 (C) Copyright, Ximian, Inc.
 //
 
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
 using System.Collections;
 
 namespace System.Runtime.Remoting.Channels
@@ -14,20 +36,23 @@ namespace System.Runtime.Remoting.Channels
                IClientFormatterSinkProvider, IClientChannelSinkProvider
        {
                IClientChannelSinkProvider next = null;
+               BinaryCore _binaryCore;
+
+#if NET_1_1
+               static string[] allowedProperties = new string [] { "includeVersions", "strictBinding", "typeFilterLevel" };
+#else
+               static string[] allowedProperties = new string [] { "includeVersions", "strictBinding" };
+#endif
 
-               // add any sink properties here (private fields)
-               
                public BinaryClientFormatterSinkProvider ()
                {
-                       // nothing to do
+                       _binaryCore = BinaryCore.DefaultInstance;
                }
 
                public BinaryClientFormatterSinkProvider (IDictionary properties,
                                                          ICollection providerData)
-               {
-                       // copy the contained properties to private fields
-                       
-                       // add a check that there is no providerData 
+               {
+                       _binaryCore = new BinaryCore (this, properties, allowedProperties);
                }
 
                public IClientChannelSinkProvider Next
@@ -52,8 +77,7 @@ namespace System.Runtime.Remoting.Channels
                                next_sink = next.CreateSink (channel, url, remoteChannelData);
                        
                        result = new BinaryClientFormatterSink (next_sink);
-
-                       // set properties on the newly creates sink
+                       result.BinaryCore = _binaryCore;
 
                        return result;
                }