Compartir a través de


BindingCollection.Item[] Propiedad

Definición

Obtiene o establece la instancia de Binding especificada por el parámetro que se ha pasado.

Sobrecargas

Item[Int32]

Obtiene o establece el valor de Binding en el índice de base cero especificado.

Item[String]

Obtiene un objeto Binding especificado por su nombre.

Item[Int32]

Source:
ServiceDescription.cs
Source:
ServiceDescription.cs
Source:
ServiceDescription.cs

Obtiene o establece el valor de Binding en el índice de base cero especificado.

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

Parámetros

index
Int32

El índice de base cero del objeto Binding cuyo valor se ha modificado o devuelto.

Valor de propiedad

Un objeto Binding.

Excepciones

El parámetro index es menor que cero.

o bien

El valor del parámetro index es mayor que el valor de la propiedad Count.

Ejemplos

for ( int i = 0; i < myServiceDescription->Bindings->Count; ++i )
{
   Console::WriteLine( "\nBinding {0}", i );

   // Get Binding at index i.
   myBinding = myServiceDescription->Bindings[ i ];
   Console::WriteLine( "\t Name : {0}", myBinding->Name );
   Console::WriteLine( "\t Type : {0}", myBinding->Type );
}
 for(int i=0; i < myServiceDescription.Bindings.Count; ++i)
  {	
     Console.WriteLine("\nBinding " + i );
      // Get Binding at index i.
    myBinding = myServiceDescription.Bindings[i];
      Console.WriteLine("\t Name : " + myBinding.Name);
      Console.WriteLine("\t Type : " + myBinding.Type);
}
Dim i As Integer

While i < myServiceDescription.Bindings.Count
   Console.WriteLine((ControlChars.Cr + "Binding " + i.ToString()))
   ' Get Binding at index i.
   myBinding = myServiceDescription.Bindings(i)
   Console.WriteLine((ControlChars.Tab + " Name : " + myBinding.Name))
   Console.WriteLine((ControlChars.Tab + " Type : " + myBinding.Type.ToString()))
   i = i + 1
End While

Se aplica a

Item[String]

Source:
ServiceDescription.cs
Source:
ServiceDescription.cs
Source:
ServiceDescription.cs

Obtiene un objeto Binding especificado por su nombre.

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

Parámetros

name
String

Nombre del objeto Binding devuelto.

Valor de propiedad

Un objeto Binding.

Ejemplos

En el ejemplo siguiente se busca en la Bindings propiedad myServiceDescription un Binding denominado "MathServiceHttpGet".

// Get Binding Name = S"MathServiceSoap".
myBinding = myServiceDescription->Bindings[ "MathServiceHttpGet" ];
if ( myBinding != nullptr )
{
   Console::WriteLine( "\n\nName : {0}", myBinding->Name );
   Console::WriteLine( "Type : {0}", myBinding->Type );
}
// Get Binding Name = "MathServiceSoap".
myBinding = myServiceDescription.Bindings["MathServiceHttpGet"];
if (myBinding != null)
{
   Console.WriteLine("\n\nName : " + myBinding.Name);
   Console.WriteLine("Type : " + myBinding.Type);
}
' Get Binding Name = "MathServiceSoap".
myBinding = myServiceDescription.Bindings("MathServiceHttpGet")
If Not (myBinding Is Nothing) Then
   Console.WriteLine((ControlChars.Cr + ControlChars.Cr + "Name : " + myBinding.Name))
   Console.WriteLine(("Type : " + myBinding.Type.ToString()))
End If

Se aplica a