Files
dotnet-bot adf899c629 Adding System.Data..., System.ServiceModel..., and System.Web...
Adding reference source for
System.Data
System.Data.DataSetExtensions
System.Data.Entity
System.Data.Entity.Design
System.Data.Linq
System.Data.SqlXml
System.ServiceModel
System.ServiceModel.Activation
System.ServiceModel.Activities
System.ServiceModel.Channels
System.ServiceModel.Discovery
System.ServiceModel.Internals
System.ServiceModel.Routing
System.ServiceModel.WasHosting
System.ServiceModel.Web
System.Web
System.Web.ApplicationServices
System.Web.DynamicData
System.Web.Entity
System.Web.Entity.Design
System.Web.Extensions
System.Web.Mobile
System.Web.Routing
System.Web.Services
System.Xml
System.Xml.Linq
2016-05-03 00:07:37 +02:00

72 lines
2.4 KiB
C#

//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace System.ServiceModel.Description
{
using System;
using System.Diagnostics;
using System.ServiceModel;
using System.ServiceModel.Web;
[DebuggerDisplay("Address={address}")]
[DebuggerDisplay("Name={name}")]
public class WebHttpEndpoint : WebServiceEndpoint
{
static Type WebHttpEndpointType = typeof(WebHttpEndpoint);
public WebHttpEndpoint(ContractDescription contract) :
this(contract, null /* address */)
{ }
public WebHttpEndpoint(ContractDescription contract, EndpointAddress address)
: base(contract, address)
{
this.Behaviors.Add(new WebHttpBehavior());
}
public bool HelpEnabled
{
get { return this.WebHttpBehavior.HelpEnabled; }
set { this.WebHttpBehavior.HelpEnabled = value; }
}
public WebMessageFormat DefaultOutgoingResponseFormat
{
get { return this.WebHttpBehavior.DefaultOutgoingResponseFormat; }
set { this.WebHttpBehavior.DefaultOutgoingResponseFormat = value; }
}
public bool AutomaticFormatSelectionEnabled
{
get { return this.WebHttpBehavior.AutomaticFormatSelectionEnabled; }
set { this.WebHttpBehavior.AutomaticFormatSelectionEnabled = value; }
}
public bool FaultExceptionEnabled
{
get { return this.WebHttpBehavior.FaultExceptionEnabled; }
set { this.WebHttpBehavior.FaultExceptionEnabled = value; }
}
WebHttpBehavior WebHttpBehavior
{
get
{
WebHttpBehavior webHttpBehavior = this.Behaviors.Find<WebHttpBehavior>();
if (webHttpBehavior == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR2.GetString(SR2.WebBehaviorNotFoundWithEndpoint, typeof(WebHttpEndpoint).Name, typeof(WebHttpBehavior).Name)));
}
return webHttpBehavior;
}
}
protected override Type WebEndpointType
{
get { return WebHttpEndpointType; }
}
}
}