当前位置: 首页>>代码示例>>C#>>正文


C# ServiceHostBase.CreateUri方法代码示例

本文整理汇总了C#中ServiceHostBase.CreateUri方法的典型用法代码示例。如果您正苦于以下问题:C# ServiceHostBase.CreateUri方法的具体用法?C# ServiceHostBase.CreateUri怎么用?C# ServiceHostBase.CreateUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ServiceHostBase的用法示例。


在下文中一共展示了ServiceHostBase.CreateUri方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: foreach

		void IServiceBehavior.ApplyDispatchBehavior (
			ServiceDescription description,
			ServiceHostBase serviceHostBase)
		{
			ServiceMetadataExtension sme = ServiceMetadataExtension.EnsureServiceMetadataExtension (serviceHostBase);

			foreach (var dispatcherBase in serviceHostBase.ChannelDispatchers) {
				var dispatcher = dispatcherBase as ChannelDispatcher;
				if (dispatcher == null) // non-ChannelDispatcher ChannelDispatcherBase instance.
					continue;
				if (IncludeExceptionDetailInFaults) // may be set also in ServiceBehaviorAttribute
					dispatcher.IncludeExceptionDetailInFaults = true;
			}

			if (HttpHelpPageEnabled) {
				Uri uri = serviceHostBase.CreateUri ("http", HttpHelpPageUrl);
				if (uri != null)
					sme.EnsureChannelDispatcher (false, "http", uri, HttpHelpPageBinding);
			}

			if (HttpsHelpPageEnabled) {
				Uri uri = serviceHostBase.CreateUri ("https", HttpsHelpPageUrl);
				if (uri != null)
					sme.EnsureChannelDispatcher (false, "https", uri, HttpsHelpPageBinding);
			}
		}
开发者ID:nickchal,项目名称:pash,代码行数:26,代码来源:ServiceDebugBehavior.cs

示例2: foreach

		void IServiceBehavior.ApplyDispatchBehavior (
			ServiceDescription description,
			ServiceHostBase serviceHostBase)
		{
			ServiceMetadataExtension sme = ServiceMetadataExtension.EnsureServiceMetadataExtension (serviceHostBase);

			foreach (ChannelDispatcher dispatcher in serviceHostBase.ChannelDispatchers)
				if (IncludeExceptionDetailInFaults) // may be set also in ServiceBehaviorAttribute
					dispatcher.IncludeExceptionDetailInFaults = true;

			if (HttpHelpPageEnabled) {
				Uri uri = serviceHostBase.CreateUri ("http", HttpHelpPageUrl);
				if (uri != null)
					// FIXME: wrong. It should add help page
					sme.EnsureChannelDispatcher (false, "http", uri, HttpHelpPageBinding);
			}

			if (HttpsHelpPageEnabled) {
				Uri uri = serviceHostBase.CreateUri ("https", HttpsHelpPageUrl);
				if (uri != null)
					// FIXME: wrong. It should add help page
					sme.EnsureChannelDispatcher (false, "https", uri, HttpsHelpPageBinding);
			}
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:24,代码来源:ServiceDebugBehavior.cs

示例3: foreach

		void IServiceBehavior.ApplyDispatchBehavior (
			ServiceDescription description,
			ServiceHostBase serviceHostBase) {

			ServiceMetadataExtension sme = ServiceMetadataExtension.EnsureServiceMetadataExtension (serviceHostBase);

			//Find ChannelDispatcher for Mex, and add a MexInstanceContextProvider
			//to it
			foreach (ChannelDispatcherBase cdb in serviceHostBase.ChannelDispatchers) {
				ChannelDispatcher cd = cdb as ChannelDispatcher;
				if (cd == null)
					continue;

				foreach (EndpointDispatcher ed in cd.Endpoints) {
					if (ed.ContractName == MexContractName)
						ed.DispatchRuntime.InstanceContextProvider = new MexInstanceContextProvider (serviceHostBase);
				}
			}

			if (HttpGetEnabled) {
				Uri uri = serviceHostBase.CreateUri ("http", HttpGetUrl);
				if (uri != null)
					sme.EnsureChannelDispatcher (true, "http", uri, HttpGetBinding);
			}

			if (HttpsGetEnabled) {
				Uri uri = serviceHostBase.CreateUri ("https", HttpsGetUrl);
				if (uri != null)
					sme.EnsureChannelDispatcher (true, "https", uri, HttpsGetBinding);
			}
		}
开发者ID:nickchal,项目名称:pash,代码行数:31,代码来源:ServiceMetadataBehavior.cs


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