當前位置: 首頁>>代碼示例>>C#>>正文


C# Dispatcher.DispatchRuntime類代碼示例

本文整理匯總了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());
 }
開發者ID:gruan01,項目名稱:Unity.WCF.4,代碼行數:7,代碼來源:UnityContractBehavior.cs

示例2: ApplyDispatchBehavior

 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime)
 {
     foreach (DispatchOperation op in dispatchRuntime.Operations)
     {
         op.ParameterInspectors.Add(new ParameterValidatorBehavior(ThrowErrorOnFirstError, ThrowErrorAfterValidation));
     }
 }
開發者ID:Chunhui-Liu,項目名稱:Blog,代碼行數:7,代碼來源:ParameterValidatorAttribute.cs

示例3: MethodInfoOperationSelector

 void IContractBehavior.ApplyDispatchBehavior(ContractDescription description, ServiceEndpoint endpoint, DispatchRuntime dispatch)
 {
     if (dispatch.ClientRuntime != null)
     {
         dispatch.ClientRuntime.OperationSelector = new MethodInfoOperationSelector(description, MessageDirection.Output);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:7,代碼來源:OperationSelectorBehavior.cs

示例4: ApplyDispatchBehavior

 public void ApplyDispatchBehavior(
   ContractDescription contractDescription,
   ServiceEndpoint endpoint,
   DispatchRuntime dispatchRuntime)
 {
     dispatchRuntime.InstanceProvider = this;
 }
開發者ID:tavisca-dhruvas,項目名稱:Training,代碼行數:7,代碼來源:UnityServiceHostFactory.cs

示例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);
 }
開發者ID:zlphoenix,項目名稱:MyDemos,代碼行數:13,代碼來源:PolicyInjectionBehaviorAttribute.cs

示例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);
 }
開發者ID:khoanguyen,項目名稱:KLib40,代碼行數:7,代碼來源:ApplyMessageInspector.cs

示例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;
        }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:25,代碼來源:EndpointDispatcher.cs

示例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));
        }
開發者ID:wildart,項目名稱:WcfRestContrib,代碼行數:33,代碼來源:ServiceAuthenticationBehavior.cs

示例9: NotImplementedException

		void IContractBehavior.ApplyDispatchBehavior (
			ContractDescription description,
			ServiceEndpoint endpoint,
			DispatchRuntime dispatch)
		{
			throw new NotImplementedException ();
		}
開發者ID:nickchal,項目名稱:pash,代碼行數:7,代碼來源:DeliveryRequirementsAttribute.cs

示例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
 }
開發者ID:enzo3m,項目名稱:DistributedComputing-WCF,代碼行數:13,代碼來源:ProcessingInstanceProvider.cs

示例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());
        }
開發者ID:JaysonJG,項目名稱:Catel,代碼行數:15,代碼來源:ContractBehavior.cs

示例15: CreateIfNeeded

 internal static TransactionBehavior CreateIfNeeded(DispatchRuntime dispatch)
 {
     if (NeedsTransactionBehavior(dispatch))
     {
         return new TransactionBehavior(dispatch);
     }
     return null;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:8,代碼來源:TransactionBehavior.cs


注:本文中的System.ServiceModel.Dispatcher.DispatchRuntime類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。