Udostępnij za pośrednictwem


FaultBindingCollection.Item[] Właściwość

Definicja

Pobiera lub ustawia FaultBinding wystąpienie określone przez przekazany parametr.

Przeciążenia

Item[Int32]

Pobiera lub ustawia wartość dla określonego FaultBinding indeksu opartego na zerze.

Item[String]

FaultBinding Pobiera określony przez jego nazwę.

Item[Int32]

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

Pobiera lub ustawia wartość dla określonego FaultBinding indeksu opartego na zerze.

public:
 property System::Web::Services::Description::FaultBinding ^ default[int] { System::Web::Services::Description::FaultBinding ^ get(int index); void set(int index, System::Web::Services::Description::FaultBinding ^ value); };
public System.Web.Services.Description.FaultBinding this[int index] { get; set; }
member this.Item(int) : System.Web.Services.Description.FaultBinding with get, set
Default Public Property Item(index As Integer) As FaultBinding

Parametry

index
Int32

Indeks oparty na zerze, FaultBinding którego wartość jest modyfikowana lub zwracana.

Wartość właściwości

Klasa FaultBinding.

Wyjątki

Parametr index jest mniejszy niż zero.

-lub-

Parametr index jest większy niż Count.

Przykłady

W poniższym przykładzie pokazano typowe użycie FaultBinding klasy .

FaultBindingCollection^ myFaultBindingCollection = myOperationBinding->Faults;
FaultBinding^ myFaultBinding = gcnew FaultBinding;
myFaultBinding->Name = "ErrorString";
// Associate SOAP fault binding to the fault binding of the operation.
myExtensions = myFaultBinding->Extensions;
SoapFaultBinding^ mySoapFaultBinding = gcnew SoapFaultBinding;
mySoapFaultBinding->Use = SoapBindingUse::Literal;
mySoapFaultBinding->Namespace = "http://www.contoso.com/stockquote";
myExtensions->Add( mySoapFaultBinding );
myFaultBindingCollection->Add( myFaultBinding );
FaultBindingCollection myFaultBindingCollection = myOperationBinding.Faults;
FaultBinding myFaultBinding = new FaultBinding();
myFaultBinding.Name = "ErrorString";
// Associate SOAP fault binding to the fault binding of the operation.
myExtensions = myFaultBinding.Extensions;
SoapFaultBinding mySoapFaultBinding = new SoapFaultBinding();
mySoapFaultBinding.Use = SoapBindingUse.Literal;
mySoapFaultBinding.Namespace = "http://www.contoso.com/stockquote";
myExtensions.Add(mySoapFaultBinding);
myFaultBindingCollection.Add(myFaultBinding);
Dim myFaultBindingCollection As FaultBindingCollection = myOperationBinding.Faults
Dim myFaultBinding As New FaultBinding()
myFaultBinding.Name = "ErrorString"
' Associate SOAP fault binding to the fault binding of the operation.
myExtensions = myFaultBinding.Extensions
Dim mySoapFaultBinding As New SoapFaultBinding()
mySoapFaultBinding.Use = SoapBindingUse.Literal
mySoapFaultBinding.Namespace = "http://www.contoso.com/stockquote"
myExtensions.Add(mySoapFaultBinding)
myFaultBindingCollection.Add(myFaultBinding)

Dotyczy

Item[String]

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

FaultBinding Pobiera określony przez jego nazwę.

public:
 property System::Web::Services::Description::FaultBinding ^ default[System::String ^] { System::Web::Services::Description::FaultBinding ^ get(System::String ^ name); };
public System.Web.Services.Description.FaultBinding this[string name] { get; }
member this.Item(string) : System.Web.Services.Description.FaultBinding
Default Public ReadOnly Property Item(name As String) As FaultBinding

Parametry

name
String

Nazwa zwróconego FaultBinding elementu.

Wartość właściwości

Klasa FaultBinding.

Przykłady

W poniższym przykładzie przedstawiono typowe użycie tej właściwości.

BindingCollection^ myBindingCollection = myServiceDescription->Bindings;
Binding^ myBinding = myBindingCollection[ 0 ];
OperationBindingCollection^ myOperationBindingCollection = myBinding->Operations;
OperationBinding^ myOperationBinding = myOperationBindingCollection[ 0 ];
FaultBindingCollection^ myFaultBindingCollection = myOperationBinding->Faults;
if ( myFaultBindingCollection->Contains( myFaultBindingCollection[ "ErrorString" ] ) )
   myFaultBindingCollection->Remove( myFaultBindingCollection[ "ErrorString" ] );
BindingCollection myBindingCollection = myServiceDescription.Bindings;
Binding myBinding = myBindingCollection[0];
OperationBindingCollection myOperationBindingCollection = myBinding.Operations;
OperationBinding myOperationBinding = myOperationBindingCollection[0];
FaultBindingCollection myFaultBindingCollection = myOperationBinding.Faults;
if(myFaultBindingCollection.Contains(myFaultBindingCollection["ErrorString"]))
   myFaultBindingCollection.Remove(myFaultBindingCollection["ErrorString"]);
Dim myBindingCollection As BindingCollection = myServiceDescription.Bindings
Dim myBinding As Binding = myBindingCollection(0)
Dim myOperationBindingCollection As OperationBindingCollection = myBinding.Operations
Dim myOperationBinding As OperationBinding = myOperationBindingCollection(0)
Dim myFaultBindingCollection As FaultBindingCollection = myOperationBinding.Faults
If myFaultBindingCollection.Contains(myFaultBindingCollection("ErrorString")) Then
   myFaultBindingCollection.Remove(myFaultBindingCollection("ErrorString"))
  End If

Dotyczy