• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Dispatcher.ClientRuntime类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.ServiceModel.Dispatcher.ClientRuntime的典型用法代码示例。如果您正苦于以下问题:C# ClientRuntime类的具体用法?C# ClientRuntime怎么用?C# ClientRuntime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ClientRuntime类属于System.ServiceModel.Dispatcher命名空间,在下文中一共展示了ClientRuntime类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
        }
开发者ID:shijiaxing,项目名称:wcf,代码行数:34,代码来源:DispatcherBuilder.cs


示例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();
 }
开发者ID:huoxudong125,项目名称:WcfEverywhere,代码行数:7,代码来源:MyBehavior.cs


示例3: ApplyClientBehavior

 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     foreach (var operation in endpoint.Contract.Operations)
     {
         DecorateFormatterBehavior(operation, clientRuntime);
     }
 }
开发者ID:peterluo0822,项目名称:wcf-1,代码行数:7,代码来源:BinaryFormatterBehavior.cs


示例4: NotImplementedException

		void IContractBehavior.ApplyClientBehavior (
			ContractDescription description,
			ServiceEndpoint endpoint,
			ClientRuntime proxy)
		{
			throw new NotImplementedException ();
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:DeliveryRequirementsAttribute.cs


示例5: ApplyClientBehavior

 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     foreach (var op in clientRuntime.ClientOperations)
     {
         op.ClientParameterInspectors.Add(new WcfServiceCallInspector(op.Parent.ContractClientType.FullName));
     }
 }
开发者ID:higeneko2015,项目名称:WCFCommon,代码行数:7,代码来源:WcfServiceLoggerBehavior.cs


示例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);

		}
开发者ID:etinquis,项目名称:nexusmodmanager,代码行数:12,代码来源:CookieEndpointBehaviour.cs


示例7: ApplyClientBehavior

 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     foreach (ClientOperation operation in clientRuntime.Operations)
     {
         operation.ParameterInspectors.Add(new ConsumerInspector());
     }
 }
开发者ID:jpsfs,项目名称:feup-tdin-wcf_silverlight,代码行数:7,代码来源:ConsumerEndpointBehavior.cs


示例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);

		}
开发者ID:NexusMods,项目名称:NexusModManager-4.5,代码行数:12,代码来源:HttpUserAgentEndpointBehaviour.cs


示例9: ArgumentNullException

        void IEndpointBehavior.ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime behavior)
        {
            if (behavior == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("behavior"));

            behavior.ValidateMustUnderstand = this.ValidateMustUnderstand;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:MustUnderstandBehavior.cs


示例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
 }
开发者ID:enzo3m,项目名称:DistributedComputing-WCF,代码行数:13,代码来源:ProcessingInstanceProvider.cs


示例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));
     }
 }
开发者ID:yonglehou,项目名称:JsonRpc.ServiceModel,代码行数:7,代码来源:JsonRpcBehavior.cs


示例12: ApplyClientBehavior

 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     if (clientRuntime != null)
     {
         clientRuntime.MessageInspectors.Add(this);
     }
 }
开发者ID:arri-cc,项目名称:azure-sdk-tools,代码行数:7,代码来源:ClientOutputMessageInspector.cs


示例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);
 }
开发者ID:JonasSyrstad,项目名称:Stardust,代码行数:7,代码来源:InspectorInserter.cs


示例14: ApplyClientBehavior

		public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
		{
			foreach (var errorHandler in errorHandlers)
			{
				clientRuntime.CallbackDispatchRuntime.ChannelDispatcher.ErrorHandlers.Add(errorHandler);
			}
		}
开发者ID:dohansen,项目名称:Windsor,代码行数:7,代码来源:WcfErrorBehavior.cs


示例15: ArgumentNullException

		void IEndpointBehavior.ApplyClientBehavior (ServiceEndpoint endpoint, ClientRuntime clientRuntime)
		{
			if (endpoint == null)
				throw new ArgumentNullException ("endpoint");
			if (clientRuntime == null)
				throw new ArgumentNullException ("clientRuntime");
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:DiscoveryEndpointPublisherBehavior.cs


示例16: ImmutableClientRuntime

        internal ImmutableClientRuntime(ClientRuntime behavior)
        {
            _channelInitializers = EmptyArray<IChannelInitializer>.ToArray(behavior.ChannelInitializers);
            _interactiveChannelInitializers = EmptyArray<IInteractiveChannelInitializer>.ToArray(behavior.InteractiveChannelInitializers);
            _messageInspectors = EmptyArray<IClientMessageInspector>.ToArray(behavior.MessageInspectors);

            _operationSelector = behavior.OperationSelector;
            _useSynchronizationContext = behavior.UseSynchronizationContext;
            _validateMustUnderstand = behavior.ValidateMustUnderstand;

            _unhandled = new ProxyOperationRuntime(behavior.UnhandledClientOperation, this);

            _addTransactionFlowProperties = behavior.AddTransactionFlowProperties;

            _operations = new Dictionary<string, ProxyOperationRuntime>();

            for (int i = 0; i < behavior.Operations.Count; i++)
            {
                ClientOperation operation = behavior.Operations[i];
                ProxyOperationRuntime operationRuntime = new ProxyOperationRuntime(operation, this);
                _operations.Add(operation.Name, operationRuntime);
            }

            _correlationCount = _messageInspectors.Length + behavior.MaxParameterInspectors;
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:wcf,代码行数:25,代码来源:ImmutableClientRuntime.cs


示例17: ApplyClientBehavior

        public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
        {
            var protoBinding = endpoint.Binding as ProtoBufBinding;

            if (protoBinding == null)
                throw new ConfigurationException("The endpoint behaviour, ProtoBufBindingEndpointBehaviour, can only be applied to an endpoint which has ProtoBufBinding as its binding.");

            foreach (var clientOperation in clientRuntime.ClientOperations)
            {
                var compressionBehaviour = protoBinding.GetOperationCompressionBehaviour(clientOperation.Name);

                var contractInfo = ContractInfo.FromAction(clientOperation.Action);

                var serviceContract = TypeFinder.FindServiceContract(contractInfo.ServiceContractName);

                var paramTypes = TypeFinder.GetContractParamTypes(serviceContract, contractInfo.OperationContractName,
                                                                  contractInfo.Action, false);

                var formatter = new ProtoBufClientFormatter(new List<TypeInfo>(paramTypes), contractInfo.Action, 
                    compressionBehaviour);

                clientOperation.Formatter = formatter;
                clientOperation.SerializeRequest = true;
                clientOperation.DeserializeReply = true;
            }
        }
开发者ID:yonglehou,项目名称:ProtoBuf.Wcf,代码行数:26,代码来源:ProtoBufBindingEndpointBehaviour.cs


示例18: ApplyClientBehavior

 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     if (clientRuntime != null && clientRuntime.CallbackDispatchRuntime != null && clientRuntime.CallbackDispatchRuntime.UnhandledDispatchOperation != null)
     {
         clientRuntime.CallbackDispatchRuntime.UnhandledDispatchOperation.Invoker = new UnhandledActionOperationInvoker();
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:UdpContractFilterBehavior.cs


示例19: ApplyClientBehavior

 public void ApplyClientBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint,
                                 ClientRuntime clientRuntime)
 {
     if (!TypeHelper.IsTypeOf<IClientMessageInspector>(_inspectorType)) return;
     var inspector = TypeHelper.CreateInstance<IClientMessageInspector>(_inspectorType);
     clientRuntime.MessageInspectors.Add(inspector);
 }
开发者ID:khoanguyen,项目名称:KLib40,代码行数:7,代码来源:ApplyMessageInspector.cs


示例20: ApplyClientBehavior

 public void ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime behavior)
 {
     // here we add one "strategy" for handling SOAP messages
     // MS designed this using the "Template Pattern", so we are able to add a
     // specific behavior that will be called during the execution of webservice.
     behavior.MessageInspectors.Add (messageInspector);
 }
开发者ID:Lysander,项目名称:snippets,代码行数:7,代码来源:XmlMessageInspector.cs



注:本文中的System.ServiceModel.Dispatcher.ClientRuntime类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Dispatcher.DispatchOperation类代码示例发布时间:2022-05-26
下一篇:
C# Dispatcher.ClientOperation类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap