* BinaryClientFormatterSink.cs, BinaryClientFormatterSinkProvider.cs,
[mono.git] / mcs / class / System.Runtime.Remoting / System.Runtime.Remoting.Channels / BinaryClientFormatterSinkProvider.cs
1 //
2 // System.Runtime.Remoting.Channels.BinaryClientFormatterSinkProvider.cs
3 //
4 // Author: Rodrigo Moya (rodrigo@ximian.com)
5 //
6 // 2002 (C) Copyright, Ximian, Inc.
7 //
8
9 using System.Collections;
10
11 namespace System.Runtime.Remoting.Channels
12 {
13         public class BinaryClientFormatterSinkProvider :
14                 IClientFormatterSinkProvider, IClientChannelSinkProvider
15         {
16                 IClientChannelSinkProvider next = null;
17                 BinaryCore _binaryCore;
18
19                 public BinaryClientFormatterSinkProvider ()
20                 {
21                         _binaryCore = BinaryCore.DefaultInstance;
22                 }
23
24                 public BinaryClientFormatterSinkProvider (IDictionary properties,
25                                                           ICollection providerData)
26                 {
27                         _binaryCore = new BinaryCore (properties);
28                 }
29
30                 public IClientChannelSinkProvider Next
31                 {
32                         get {
33                                 return next;
34                         }
35                         
36                         set {
37                                 next = value;
38                         }
39                 }
40
41                 public IClientChannelSink CreateSink (IChannelSender channel,
42                                                       string url,
43                                                       object remoteChannelData)
44                 {
45                         IClientChannelSink next_sink = null;
46                         BinaryClientFormatterSink result;
47                         
48                         if (next != null)
49                                 next_sink = next.CreateSink (channel, url, remoteChannelData);
50                         
51                         result = new BinaryClientFormatterSink (next_sink);
52                         result.BinaryCore = _binaryCore;
53
54                         return result;
55                 }               
56         }
57 }