Editare

Partajați prin


BindingContext Constructors

Definition

Initializes a new instance of the BindingContext class.

Overloads

BindingContext(CustomBinding, BindingParameterCollection)

Initializes a new instance of the BindingContext class for a specified binding and collection of binding parameters.

BindingContext(CustomBinding, BindingParameterCollection, Uri, String, ListenUriMode)

Initializes a new instance of the BindingContext class for a specified binding, collection of binding parameters, and address for the endpoint at which the service listens.

BindingContext(CustomBinding, BindingParameterCollection)

Source:
BindingContext.cs
Source:
BindingContext.cs
Source:
BindingContext.cs

Initializes a new instance of the BindingContext class for a specified binding and collection of binding parameters.

public:
 BindingContext(System::ServiceModel::Channels::CustomBinding ^ binding, System::ServiceModel::Channels::BindingParameterCollection ^ parameters);
public BindingContext (System.ServiceModel.Channels.CustomBinding binding, System.ServiceModel.Channels.BindingParameterCollection parameters);
new System.ServiceModel.Channels.BindingContext : System.ServiceModel.Channels.CustomBinding * System.ServiceModel.Channels.BindingParameterCollection -> System.ServiceModel.Channels.BindingContext
Public Sub New (binding As CustomBinding, parameters As BindingParameterCollection)

Parameters

binding
CustomBinding

The CustomBinding for the channel.

parameters
BindingParameterCollection

The BindingParameterCollection for the channel.

Exceptions

binding is null.

Examples

CustomBinding binding = new CustomBinding();
BindingParameterCollection bpCol = new BindingParameterCollection();
BindingContext context = new BindingContext(binding, bpCol);
Dim binding As New CustomBinding()
Dim bpCol As New BindingParameterCollection()
Dim context As New BindingContext(binding, bpCol)

Remarks

The value of ListenUriMode is set to Explicit by this constructor, the relative address is set to Empty, and the base address is set to null.

Applies to

BindingContext(CustomBinding, BindingParameterCollection, Uri, String, ListenUriMode)

Initializes a new instance of the BindingContext class for a specified binding, collection of binding parameters, and address for the endpoint at which the service listens.

public:
 BindingContext(System::ServiceModel::Channels::CustomBinding ^ binding, System::ServiceModel::Channels::BindingParameterCollection ^ parameters, Uri ^ listenUriBaseAddress, System::String ^ listenUriRelativeAddress, System::ServiceModel::Description::ListenUriMode listenUriMode);
public BindingContext (System.ServiceModel.Channels.CustomBinding binding, System.ServiceModel.Channels.BindingParameterCollection parameters, Uri listenUriBaseAddress, string listenUriRelativeAddress, System.ServiceModel.Description.ListenUriMode listenUriMode);
new System.ServiceModel.Channels.BindingContext : System.ServiceModel.Channels.CustomBinding * System.ServiceModel.Channels.BindingParameterCollection * Uri * string * System.ServiceModel.Description.ListenUriMode -> System.ServiceModel.Channels.BindingContext
Public Sub New (binding As CustomBinding, parameters As BindingParameterCollection, listenUriBaseAddress As Uri, listenUriRelativeAddress As String, listenUriMode As ListenUriMode)

Parameters

binding
CustomBinding

The CustomBinding for the channel.

parameters
BindingParameterCollection

The BindingParameterCollection for the channel.

listenUriBaseAddress
Uri

The Uri at which the service endpoint listens.

listenUriRelativeAddress
String

The relative address at which the service endpoint listens.

listenUriMode
ListenUriMode

The ListenUriMode that indicates whether the transport must ensure that the URI provided for the service to listen on is unique.

Exceptions

binding is null.

Examples

CustomBinding binding = new CustomBinding();
BindingParameterCollection bpCol = new BindingParameterCollection();
Uri baseAddress = new Uri("http://MyServer/Base");
string relAddress = "MyService";
BindingContext context = new BindingContext(binding, bpCol, baseAddress, relAddress, ListenUriMode.Explicit);
Dim binding As New CustomBinding()
Dim bpCol As New BindingParameterCollection()
Dim baseAddress As New Uri("http://MyServer/Base")
Dim relAddress As String = "MyService"
Dim context As New BindingContext(binding, bpCol, baseAddress, relAddress, ListenUriMode.Explicit)

Applies to