Update Reference Sources to .NET Framework 4.6.1
[mono.git] / mcs / class / referencesource / System.ServiceModel / System / ServiceModel / Dispatcher / ReplyChannelBinder.cs
1 //-----------------------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //-----------------------------------------------------------------------------
4
5 namespace System.ServiceModel.Dispatcher
6 {
7     using System;
8     using System.Runtime;
9     using System.ServiceModel;
10     using System.ServiceModel.Channels;
11     using System.ServiceModel.Diagnostics;
12
13     class ReplyChannelBinder : IChannelBinder
14     {
15         IReplyChannel channel;
16         Uri listenUri;
17
18         internal ReplyChannelBinder(IReplyChannel channel, Uri listenUri)
19         {
20             if (channel == null)
21             {
22                 Fx.Assert("ReplyChannelBinder.ReplyChannelBinder: (channel != null)");
23                 throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("channel");
24             }
25             this.channel = channel;
26             this.listenUri = listenUri;
27         }
28
29         public IChannel Channel
30         {
31             get { return this.channel; }
32         }
33
34         public bool HasSession
35         {
36             get { return this.channel is ISessionChannel<IInputSession>; }
37         }
38
39         public Uri ListenUri
40         {
41             get { return this.listenUri; }
42         }
43
44         public EndpointAddress LocalAddress
45         {
46             get { return this.channel.LocalAddress; }
47         }
48
49         public EndpointAddress RemoteAddress
50         {
51             get
52             {
53 #pragma warning suppress 56503 // [....], the property is really not implemented, cannot lie, API not public
54                 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException()); 
55             }
56         }
57
58         public void Abort()
59         {
60             this.channel.Abort();
61         }
62
63         public void CloseAfterFault(TimeSpan timeout)
64         {
65             this.channel.Close(timeout);
66         }
67
68         public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state)
69         {
70             return this.channel.BeginTryReceiveRequest(timeout, callback, state);
71         }
72
73         public bool EndTryReceive(IAsyncResult result, out RequestContext requestContext)
74         {
75             return this.channel.EndTryReceiveRequest(result, out requestContext);
76         }
77
78         public RequestContext CreateRequestContext(Message message)
79         {
80             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
81         }
82
83         public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state)
84         {
85             throw TraceUtility.ThrowHelperError(new NotImplementedException(), message);
86         }
87
88         public void EndSend(IAsyncResult result)
89         {
90             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
91         }
92
93         public void Send(Message message, TimeSpan timeout)
94         {
95             throw TraceUtility.ThrowHelperError(new NotImplementedException(), message);
96         }
97
98         public IAsyncResult BeginRequest(Message message, TimeSpan timeout, AsyncCallback callback, object state)
99         {
100             throw TraceUtility.ThrowHelperError(new NotImplementedException(), message);
101         }
102
103         public Message EndRequest(IAsyncResult result)
104         {
105             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
106         }
107
108         public bool TryReceive(TimeSpan timeout, out RequestContext requestContext)
109         {
110             return this.channel.TryReceiveRequest(timeout, out requestContext);
111         }
112
113         public Message Request(Message message, TimeSpan timeout)
114         {
115             throw TraceUtility.ThrowHelperError(new NotImplementedException(), message);
116         }
117
118         public bool WaitForMessage(TimeSpan timeout)
119         {
120             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
121         }
122
123         public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state)
124         {
125             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
126         }
127
128         public bool EndWaitForMessage(IAsyncResult result)
129         {
130             throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException());
131         }
132     }
133 }