-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathRicohEmbeddedEndpointBehavior.cs
More file actions
66 lines (60 loc) · 2.45 KB
/
RicohEmbeddedEndpointBehavior.cs
File metadata and controls
66 lines (60 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using System.ServiceModel.Channels;
using System.ServiceModel.Configuration;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;
namespace Ricoh
{
/// <summary>
/// Specifies an endpoint behavior that automatically applies the RicohEmbeddedMessageInspector
/// </summary>
public class RicohEmbeddedEndpointBehavior : BehaviorExtensionElement, IEndpointBehavior
{
/// <summary>Gets the type of behavior.</summary>
public override Type BehaviorType
{
get { return typeof(RicohEmbeddedEndpointBehavior); }
}
/// <summary>
/// Creates a behavior extension based on the current configuration settings.
/// </summary>
/// <returns>
/// The behavior extension.
/// </returns>
protected override object CreateBehavior()
{
// Create the endpoint behavior that will insert the message
// inspector into the client runtime
return (new RicohEmbeddedEndpointBehavior());
}
/// <summary>
/// Implement to pass data at runtime to bindings to support custom behavior.
/// </summary>
/// <param name="endpoint">The endpoint to modify.</param><param name="bindingParameters">The objects that binding elements require to support the behavior.</param>
public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
{
}
/// <summary>
/// Implements a modification or extension of the client across an endpoint.
/// </summary>
/// <param name="endpoint">The endpoint that is to be customized.</param><param name="clientRuntime">The client runtime to be customized.</param>
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
clientRuntime.MessageInspectors.Add(new RicohEmbeddedMessageInspector());
}
/// <summary>
/// Implements a modification or extension of the service across an endpoint.
/// </summary>
/// <param name="endpoint">The endpoint that exposes the contract.</param><param name="endpointDispatcher">The endpoint dispatcher to be modified or extended.</param>
public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
}
/// <summary>
/// Implement to confirm that the endpoint meets some intended criteria.
/// </summary>
/// <param name="endpoint">The endpoint to validate.</param>
public void Validate(ServiceEndpoint endpoint)
{
}
}
}