BindingContext 构造函数

定义

初始化 BindingContext 类的新实例。

重载

BindingContext(CustomBinding, BindingParameterCollection)

使用指定的绑定和绑定参数集合初始化 BindingContext 类的新实例。

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

使用指定的绑定、绑定参数集合以及服务侦听的终结点的地址初始化 BindingContext 类的新实例。

BindingContext(CustomBinding, BindingParameterCollection)

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

使用指定的绑定和绑定参数集合初始化 BindingContext 类的新实例。

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)

参数

binding
CustomBinding

通道的 CustomBinding

例外

bindingnull

示例

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)

注解

此构造函数将 ListenUriMode 的值设置为 Explicit,相对地址设置为 Empty,基址设置为 null

适用于

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

使用指定的绑定、绑定参数集合以及服务侦听的终结点的地址初始化 BindingContext 类的新实例。

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)

参数

binding
CustomBinding

通道的 CustomBinding

listenUriBaseAddress
Uri

服务终结点侦听的 Uri

listenUriRelativeAddress
String

服务终结点侦听的相对地址。

listenUriMode
ListenUriMode

ListenUriMode,指示传输是否必须确保提供给服务侦听的 URI 是唯一的。

例外

bindingnull

示例

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)

适用于