Udostępnij za pośrednictwem


CustomBinding Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy CustomBinding.

Przeciążenia

CustomBinding()

Inicjuje nowe wystąpienie klasy CustomBinding.

CustomBinding(IEnumerable<BindingElement>)

Inicjuje CustomBinding nowe wystąpienie klasy z elementami powiązania z kompletnym stosem kanału.

CustomBinding(Binding)

Inicjuje CustomBinding nowe wystąpienie klasy z wartości określonego powiązania.

CustomBinding(BindingElement[])

Inicjuje CustomBinding nowe wystąpienie klasy z tablicy elementów powiązania.

CustomBinding(String)

Inicjuje nowe wystąpienie klasy CustomBinding.

CustomBinding(String, String, BindingElement[])

Inicjuje CustomBinding nowe wystąpienie klasy z tablicy elementów powiązania z określoną nazwą i przestrzenią nazw.

CustomBinding()

Źródło:
CustomBinding.cs
Źródło:
CustomBinding.cs
Źródło:
CustomBinding.cs

Inicjuje nowe wystąpienie klasy CustomBinding.

public:
 CustomBinding();
public CustomBinding ();
Public Sub New ()

Przykłady

W poniższym przykładzie pokazano, jak używać konstruktora bez parametrów:

Dotyczy

CustomBinding(IEnumerable<BindingElement>)

Źródło:
CustomBinding.cs
Źródło:
CustomBinding.cs
Źródło:
CustomBinding.cs

Inicjuje CustomBinding nowe wystąpienie klasy z elementami powiązania z kompletnym stosem kanału.

public:
 CustomBinding(System::Collections::Generic::IEnumerable<System::ServiceModel::Channels::BindingElement ^> ^ bindingElementsInTopDownChannelStackOrder);
public CustomBinding (System.Collections.Generic.IEnumerable<System.ServiceModel.Channels.BindingElement> bindingElementsInTopDownChannelStackOrder);
new System.ServiceModel.Channels.CustomBinding : seq<System.ServiceModel.Channels.BindingElement> -> System.ServiceModel.Channels.CustomBinding
Public Sub New (bindingElementsInTopDownChannelStackOrder As IEnumerable(Of BindingElement))

Parametry

bindingElementsInTopDownChannelStackOrder
IEnumerable<BindingElement>

BindingElement Typ IEnumerable<T> zawierający elementy powiązania stosu kanału w kolejności od góry do dołu.

Wyjątki

bindingElementsInTopDownChannelStackOrder to null.

Przykłady

Uri baseAddress = new Uri("http://localhost:8000/servicemodelsamples/service");

// Create a ServiceHost for the CalculatorService type and provide the base address.
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

// Create a custom binding that contains two binding elements.
ReliableSessionBindingElement reliableSession = new ReliableSessionBindingElement();
reliableSession.Ordered = true;

HttpTransportBindingElement httpTransport = new HttpTransportBindingElement();
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous;
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;

SynchronizedCollection<BindingElement> coll = new SynchronizedCollection<BindingElement>();
coll.Add(reliableSession);
coll.Add(httpTransport);

CustomBinding binding = new CustomBinding(coll);
Dim baseAddress As New Uri("http://localhost:8000/servicemodelsamples/service")

' Create a ServiceHost for the CalculatorService type and provide the base address.
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

' Create a custom binding that contains two binding elements.
Dim reliableSession As New ReliableSessionBindingElement()
reliableSession.Ordered = True

Dim httpTransport As New HttpTransportBindingElement()
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard

Dim coll As New SynchronizedCollection(Of BindingElement)()
coll.Add(reliableSession)
coll.Add(httpTransport)

Dim binding As New CustomBinding(coll)

Dotyczy

CustomBinding(Binding)

Źródło:
CustomBinding.cs
Źródło:
CustomBinding.cs
Źródło:
CustomBinding.cs

Inicjuje CustomBinding nowe wystąpienie klasy z wartości określonego powiązania.

public:
 CustomBinding(System::ServiceModel::Channels::Binding ^ binding);
public CustomBinding (System.ServiceModel.Channels.Binding binding);
new System.ServiceModel.Channels.CustomBinding : System.ServiceModel.Channels.Binding -> System.ServiceModel.Channels.CustomBinding
Public Sub New (binding As Binding)

Parametry

binding
Binding

Element Binding służący do inicjowania powiązania niestandardowego.

Wyjątki

binding to null.

Dotyczy

CustomBinding(BindingElement[])

Źródło:
CustomBinding.cs
Źródło:
CustomBinding.cs
Źródło:
CustomBinding.cs

Inicjuje CustomBinding nowe wystąpienie klasy z tablicy elementów powiązania.

public:
 CustomBinding(... cli::array <System::ServiceModel::Channels::BindingElement ^> ^ bindingElementsInTopDownChannelStackOrder);
public CustomBinding (params System.ServiceModel.Channels.BindingElement[] bindingElementsInTopDownChannelStackOrder);
new System.ServiceModel.Channels.CustomBinding : System.ServiceModel.Channels.BindingElement[] -> System.ServiceModel.Channels.CustomBinding
Public Sub New (ParamArray bindingElementsInTopDownChannelStackOrder As BindingElement())

Parametry

bindingElementsInTopDownChannelStackOrder
BindingElement[]

Array Typ BindingElement używany do inicjowania powiązania niestandardowego.

Wyjątki

bindingElementsInTopDownChannelStackOrder to null.

Przykłady

 Uri baseAddress = new Uri("http://localhost:8000/servicemodelsamples/service");

// Create a ServiceHost for the CalculatorService type and provide the base address.
 ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

// Create a custom binding that contains two binding elements.
ReliableSessionBindingElement reliableSession = new ReliableSessionBindingElement();
reliableSession.Ordered = true;

HttpTransportBindingElement httpTransport = new HttpTransportBindingElement();
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous;
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;

BindingElement[] elements = new BindingElement[2];
elements[0] = reliableSession;
elements[1] = httpTransport;

CustomBinding binding = new CustomBinding(elements);
 Dim baseAddress As New Uri("http://localhost:8000/servicemodelsamples/service")

' Create a ServiceHost for the CalculatorService type and provide the base address.
 Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

' Create a custom binding that contains two binding elements.
Dim reliableSession As New ReliableSessionBindingElement()
reliableSession.Ordered = True

Dim httpTransport As New HttpTransportBindingElement()
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard

Dim elements(1) As BindingElement
elements(0) = reliableSession
elements(1) = httpTransport

Dim binding As New CustomBinding(elements)

Dotyczy

CustomBinding(String)

Inicjuje nowe wystąpienie klasy CustomBinding.

public:
 CustomBinding(System::String ^ configurationName);
public CustomBinding (string configurationName);
new System.ServiceModel.Channels.CustomBinding : string -> System.ServiceModel.Channels.CustomBinding
Public Sub New (configurationName As String)

Parametry

configurationName
String

Wartość atrybutu configurationName identyfikująca binding element, którego ustawienia są używane do inicjowania powiązania.

Wyjątki

Element powiązania zidentyfikowany przez configurationName element to null.

Dotyczy

CustomBinding(String, String, BindingElement[])

Źródło:
CustomBinding.cs
Źródło:
CustomBinding.cs
Źródło:
CustomBinding.cs

Inicjuje CustomBinding nowe wystąpienie klasy z tablicy elementów powiązania z określoną nazwą i przestrzenią nazw.

public:
 CustomBinding(System::String ^ name, System::String ^ ns, ... cli::array <System::ServiceModel::Channels::BindingElement ^> ^ bindingElementsInTopDownChannelStackOrder);
public CustomBinding (string name, string ns, params System.ServiceModel.Channels.BindingElement[] bindingElementsInTopDownChannelStackOrder);
new System.ServiceModel.Channels.CustomBinding : string * string * System.ServiceModel.Channels.BindingElement[] -> System.ServiceModel.Channels.CustomBinding
Public Sub New (name As String, ns As String, ParamArray bindingElementsInTopDownChannelStackOrder As BindingElement())

Parametry

name
String

Nazwa powiązania.

ns
String

Przestrzeń nazw powiązania.

bindingElementsInTopDownChannelStackOrder
BindingElement[]

Array Typ BindingElement używany do inicjowania powiązania niestandardowego.

Wyjątki

bindingElementsInTopDownChannelStackOrder to null.

Przykłady

Uri baseAddress = new Uri("http://localhost:8000/servicemodelsamples/service");

// Create a ServiceHost for the CalculatorService type and provide the base address.
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

// Create a custom binding that contains two binding elements.
ReliableSessionBindingElement reliableSession = new ReliableSessionBindingElement();
reliableSession.Ordered = true;

HttpTransportBindingElement httpTransport = new HttpTransportBindingElement();
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous;
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;

BindingElement[] elements = new BindingElement[2];
elements[0] = reliableSession;
elements[1] = httpTransport;

CustomBinding binding = new CustomBinding("MyCustomBinding", "http://localhost/service", elements);
Dim baseAddress As New Uri("http://localhost:8000/servicemodelsamples/service")

' Create a ServiceHost for the CalculatorService type and provide the base address.
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

' Create a custom binding that contains two binding elements.
Dim reliableSession As New ReliableSessionBindingElement()
reliableSession.Ordered = True

Dim httpTransport As New HttpTransportBindingElement()
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard

Dim elements(1) As BindingElement
elements(0) = reliableSession
elements(1) = httpTransport

Dim binding As New CustomBinding("MyCustomBinding", "http://localhost/service", elements)

Dotyczy