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