private void RegisterErrorHandlerBehavior(ErrorHandlerBehavior errorHandlerBehavior, ServiceHostBase host)
		{
			if (host.Description.Behaviors.Find<ErrorHandlerBehavior>() == null)
			{
				host.Description.Behaviors.Add(errorHandlerBehavior);
			}
		}
Beispiel #2
0
 private void RegisterErrorHandlerBehavior(ErrorHandlerBehavior errorHandlerBehavior, ServiceHostBase host)
 {
     if (host.Description.Behaviors.Find <ErrorHandlerBehavior>() == null)
     {
         host.Description.Behaviors.Add(errorHandlerBehavior);
     }
 }
		public EncapsulatedHost(
			ServiceHost host,
			Type serviceContractType,
			object service,
			Binding binding,
			string url,
			bool registerErrorHandler)
		{
			this.host = host;
			host.AddServiceEndpoint(serviceContractType, binding, url);

			RegisterServiceDebugBehavior(host);

			RegisterDependencyServiceBehavior(service, host);

			if (!registerErrorHandler)
			{
				return;
			}

			errorHandlerBehavior = new ErrorHandlerBehavior();
			RegisterErrorHandlerBehavior(errorHandlerBehavior, host);
		}
Beispiel #4
0
        public EncapsulatedHost(
            ServiceHost host,
            Type serviceContractType,
            object service,
            Binding binding,
            string url,
            bool registerErrorHandler)
        {
            this.host = host;
            host.AddServiceEndpoint(serviceContractType, binding, url);

            RegisterServiceDebugBehavior(host);

            RegisterDependencyServiceBehavior(service, host);

            if (!registerErrorHandler)
            {
                return;
            }

            errorHandlerBehavior = new ErrorHandlerBehavior();
            RegisterErrorHandlerBehavior(errorHandlerBehavior, host);
        }