本文整理匯總了C#中System.ServiceModel.Dispatcher.DispatchRuntime類的典型用法代碼示例。如果您正苦於以下問題:C# DispatchRuntime類的具體用法?C# DispatchRuntime怎麽用?C# DispatchRuntime使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DispatchRuntime類屬於System.ServiceModel.Dispatcher命名空間,在下文中一共展示了DispatchRuntime類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime)
{
if (dispatchRuntime == null)
throw new ArgumentNullException("dispatchRuntime");
dispatchRuntime.InstanceProvider = this.instanceProvider;
dispatchRuntime.InstanceContextInitializers.Add((IInstanceContextInitializer) new UnityInstanceContextInitializer());
}
示例2: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime)
{
foreach (DispatchOperation op in dispatchRuntime.Operations)
{
op.ParameterInspectors.Add(new ParameterValidatorBehavior(ThrowErrorOnFirstError, ThrowErrorAfterValidation));
}
}
示例3: MethodInfoOperationSelector
void IContractBehavior.ApplyDispatchBehavior(ContractDescription description, ServiceEndpoint endpoint, DispatchRuntime dispatch)
{
if (dispatch.ClientRuntime != null)
{
dispatch.ClientRuntime.OperationSelector = new MethodInfoOperationSelector(description, MessageDirection.Output);
}
}
示例4: ApplyDispatchBehavior
public void ApplyDispatchBehavior(
ContractDescription contractDescription,
ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
dispatchRuntime.InstanceProvider = this;
}
示例5: ApplyDispatchBehavior
/// <summary>
/// 注冊 服務實例創建提供者,將基於PIAB的實例生成器注入WCF擴展
/// </summary>
/// <param name="contractDescription"></param>
/// <param name="endpoint"></param>
/// <param name="dispatchRuntime"></param>
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
Type serviceContractType = contractDescription.ContractType;
dispatchRuntime.InstanceProvider = new PolicyInjectionInstanceProvider(serviceContractType,
this.PolicyInjectorName);
}
示例6: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
if (!TypeHelper.IsTypeOf<IDispatchMessageInspector>(_inspectorType)) return;
var inspector = TypeHelper.CreateInstance<IDispatchMessageInspector>(_inspectorType);
dispatchRuntime.MessageInspectors.Add(inspector);
}
示例7: EndpointDispatcher
EndpointDispatcher(EndpointDispatcher baseEndpoint, IEnumerable<AddressHeader> headers)
{
EndpointAddressBuilder builder = new EndpointAddressBuilder(baseEndpoint.EndpointAddress);
foreach (AddressHeader h in headers)
{
builder.Headers.Add(h);
}
EndpointAddress address = builder.ToEndpointAddress();
this.addressFilter = new EndpointAddressMessageFilter(address);
// channelDispatcher is Attached
this.contractFilter = baseEndpoint.ContractFilter;
this.contractName = baseEndpoint.ContractName;
this.contractNamespace = baseEndpoint.ContractNamespace;
this.dispatchRuntime = baseEndpoint.DispatchRuntime;
// endpointFilter is lazy
this.filterPriority = baseEndpoint.FilterPriority + 1;
this.originalAddress = address;
if (PerformanceCounters.PerformanceCountersEnabled)
{
this.perfCounterId = baseEndpoint.perfCounterId;
this.perfCounterBaseId = baseEndpoint.perfCounterBaseId;
}
this.id = baseEndpoint.id;
}
示例8: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime)
{
var behavior =
dispatchRuntime.ChannelDispatcher.Host.Description.FindBehavior
<WebAuthenticationConfigurationBehavior,
WebAuthenticationConfigurationAttribute>(b => b.BaseBehavior);
if (behavior == null)
behavior = contractDescription.FindBehavior
<WebAuthenticationConfigurationBehavior,
WebAuthenticationConfigurationAttribute>(b => b.BaseBehavior);
if (behavior == null)
throw new ServiceAuthenticationConfigurationMissingException();
var authorizationBehavior =
dispatchRuntime.ChannelDispatcher.Host.Description.FindBehavior
<WebAuthorizationConfigurationBehavior,
WebAuthorizationConfigurationAttribute>(b => b.BaseBehavior);
Type authorizationPolicy = null;
if (authorizationBehavior != null)
authorizationPolicy = authorizationBehavior.AuthorizationPolicyType;
foreach (var endpointDispatcher in dispatchRuntime.ChannelDispatcher.Endpoints)
endpointDispatcher.DispatchRuntime.MessageInspectors.Add(
new ServiceAuthenticationInspector(
behavior.ThrowIfNull().AuthenticationHandler,
behavior.UsernamePasswordValidatorType,
behavior.RequireSecureTransport,
behavior.Source,
authorizationPolicy));
}
示例9: NotImplementedException
void IContractBehavior.ApplyDispatchBehavior (
ContractDescription description,
ServiceEndpoint endpoint,
DispatchRuntime dispatch)
{
throw new NotImplementedException ();
}
示例10: ApplyDispatchBehavior
/// <summary>
///
/// </summary>
/// <param name="contractDescription"></param>
/// <param name="endpoint"></param>
/// <param name="dispatchRuntime">The runtime object that can be used to modify the default service behavior.</param>
public void ApplyDispatchBehavior(
ContractDescription contractDescription,
ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
dispatchRuntime.InstanceProvider = this; // set the provider to manage service objects instantiation
}
示例11: ApplyDispatchBehavior
void IContractBehavior.ApplyDispatchBehavior(ContractDescription contract, ServiceEndpoint endpoint, DispatchRuntime runtime)
{
//if (s_Logger.IsDebugEnabled)
//{
// s_Logger.DebugFormat("Applying dispatch ExceptionMarshallingBehavior to contract {0}", contract.ContractType.FullName);
//}
ApplyDispatchBehavior(runtime.ChannelDispatcher);
}
開發者ID:jandppw,項目名稱:ppwcode-recovered-from-google-code,代碼行數:8,代碼來源:ExceptionMarshallingBehaviorAttribute.cs
示例12: ApplyDispatchBehavior
/// <summary>
/// Implements a modification or extension of the client across a contract.
/// </summary>
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
foreach (OperationDescription od in contractDescription.Operations)
{
InjectNetDataContractSerializer(od);
}
}
開發者ID:ChristianWeyer,項目名稱:Thinktecture.ServiceModel,代碼行數:11,代碼來源:NetDataContractSerializerFormatAttribute.cs
示例13: CreateIfNecessary
public static TerminatingOperationBehavior CreateIfNecessary(DispatchRuntime dispatch)
{
if (IsTerminatingOperationBehaviorNeeded(dispatch))
{
return new TerminatingOperationBehavior();
}
return null;
}
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:TerminatingOperationBehavior.cs
示例14: ApplyDispatchBehavior
/// <summary>
/// Implements a modification or extension of the client across a contract.
/// </summary>
/// <param name="contractDescription">The contract description to be modified.</param>
/// <param name="endpoint">The endpoint that exposes the contract.</param>
/// <param name="dispatchRuntime">The dispatch runtime that controls service execution.</param>
/// <exception cref="ArgumentNullException">The <paramref name="dispatchRuntime"/> is <c>null</c>.</exception>
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
Argument.IsNotNull("dispatchRuntime", dispatchRuntime);
dispatchRuntime.InstanceProvider = _instanceProvider;
dispatchRuntime.InstanceContextInitializers.Add(new InstanceContextInitializer());
}
示例15: CreateIfNeeded
internal static TransactionBehavior CreateIfNeeded(DispatchRuntime dispatch)
{
if (NeedsTransactionBehavior(dispatch))
{
return new TransactionBehavior(dispatch);
}
return null;
}