本文整理汇总了C#中System.ServiceModel.Dispatcher.ClientRuntime类的典型用法代码示例。如果您正苦于以下问题:C# ClientRuntime类的具体用法?C# ClientRuntime怎么用?C# ClientRuntime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientRuntime类属于System.ServiceModel.Dispatcher命名空间,在下文中一共展示了ClientRuntime类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildProxyBehavior
internal static ClientRuntime BuildProxyBehavior(ServiceEndpoint serviceEndpoint, out BindingParameterCollection parameters)
{
parameters = new BindingParameterCollection();
SecurityContractInformationEndpointBehavior.ClientInstance.AddBindingParameters(serviceEndpoint, parameters);
AddBindingParameters(serviceEndpoint, parameters);
ContractDescription contractDescription = serviceEndpoint.Contract;
ClientRuntime clientRuntime = new ClientRuntime(contractDescription.Name, contractDescription.Namespace);
clientRuntime.ContractClientType = contractDescription.ContractType;
IdentityVerifier identityVerifier = serviceEndpoint.Binding.GetProperty<IdentityVerifier>(parameters);
if (identityVerifier != null)
{
clientRuntime.IdentityVerifier = identityVerifier;
}
for (int i = 0; i < contractDescription.Operations.Count; i++)
{
OperationDescription operation = contractDescription.Operations[i];
if (!operation.IsServerInitiated())
{
DispatcherBuilder.BuildProxyOperation(operation, clientRuntime);
}
else
{
DispatcherBuilder.BuildDispatchOperation(operation, clientRuntime.CallbackDispatchRuntime);
}
}
DispatcherBuilder.ApplyClientBehavior(serviceEndpoint, clientRuntime);
return clientRuntime;
}
示例2: ApplyClientBehavior
public void ApplyClientBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
clientRuntime.ChannelInitializers.Add(new MyChannelInitializer(false));
clientRuntime.InteractiveChannelInitializers.Add(new MyInteractiveChannelInitializer());
clientRuntime.MessageInspectors.Add(new MyClientMessageInspector());
clientRuntime.OperationSelector = new MyClientOperationSelector();
}
示例3: ApplyClientBehavior
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
foreach (var operation in endpoint.Contract.Operations)
{
DecorateFormatterBehavior(operation, clientRuntime);
}
}
示例4: NotImplementedException
void IContractBehavior.ApplyClientBehavior (
ContractDescription description,
ServiceEndpoint endpoint,
ClientRuntime proxy)
{
throw new NotImplementedException ();
}
示例5: ApplyClientBehavior
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
foreach (var op in clientRuntime.ClientOperations)
{
op.ClientParameterInspectors.Add(new WcfServiceCallInspector(op.Parent.ContractClientType.FullName));
}
}
示例6: ApplyClientBehavior
/// <summary>
/// Injects the user agent into the service request.
/// </summary>
/// <param name="endpoint">The enpoint of the service for which to set the user-agent.</param>
/// <param name="clientRuntime">The client runtime.</param>
public override void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
base.ApplyClientBehavior(endpoint, clientRuntime);
CookieMessageInspector cmiInspector = new CookieMessageInspector(m_dicAuthenticationCookies);
clientRuntime.MessageInspectors.Add(cmiInspector);
}
示例7: ApplyClientBehavior
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
foreach (ClientOperation operation in clientRuntime.Operations)
{
operation.ParameterInspectors.Add(new ConsumerInspector());
}
}
示例8: ApplyClientBehavior
/// <summary>
/// Injects the user agent into the service request.
/// </summary>
/// <param name="endpoint">The enpoint of the service for which to set the user-agent.</param>
/// <param name="clientRuntime">The client runtime.</param>
public override void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
base.ApplyClientBehavior(endpoint, clientRuntime);
HttpUserAgentMessageInspector amiInspector = new HttpUserAgentMessageInspector(this.m_userAgent);
clientRuntime.MessageInspectors.Add(amiInspector);
}
示例9: ArgumentNullException
void IEndpointBehavior.ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime behavior)
{
if (behavior == null)
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("behavior"));
behavior.ValidateMustUnderstand = this.ValidateMustUnderstand;
}
示例10: ApplyClientBehavior
/// <summary>
///
/// </summary>
/// <param name="contractDescription"></param>
/// <param name="endpoint"></param>
/// <param name="clientRuntime"></param>
public void ApplyClientBehavior(
ContractDescription contractDescription,
ServiceEndpoint endpoint,
ClientRuntime clientRuntime)
{
// empty
}
示例11: ApplyClientBehavior
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
foreach (var op in endpoint.Contract.Operations) {
if (op.Behaviors.Find<JsonRpcOperationBehavior>() == null)
op.Behaviors.Add(new JsonRpcOperationBehavior(endpoint));
}
}
示例12: ApplyClientBehavior
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
if (clientRuntime != null)
{
clientRuntime.MessageInspectors.Add(this);
}
}
示例13: ApplyClientBehavior
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
var inspector=new ClientHeaderInspector();
clientRuntime.ClientMessageInspectors.Add(inspector);
foreach (var op in clientRuntime.Operations)
op.ParameterInspectors.Add(inspector);
}
示例14: ApplyClientBehavior
public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
foreach (var errorHandler in errorHandlers)
{
clientRuntime.CallbackDispatchRuntime.ChannelDispatcher.ErrorHandlers.Add(errorHandler);
}
}
示例15: ArgumentNullException
void IEndpointBehavior.ApplyClientBehavior (ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
if (endpoint == null)
throw new ArgumentNullException ("endpoint");
if (clientRuntime == null)
throw new ArgumentNullException ("clientRuntime");
}