Compartir a través de


ServiceCollection.Item[] Propiedad

Definición

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

Sobrecargas

Item[Int32]

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

Item[String]

Obtiene un objeto Service especificado por su nombre.

Item[Int32]

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

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

Parámetros

index
Int32

Índice de base cero de Service que se va a modificar o devolver.

Valor de propiedad

Service

Objeto Service.

Ejemplos

// Read a ServiceDescription from existing WSDL.
ServiceDescription^ myServiceDescription = ServiceDescription::Read( "Input_CS.wsdl" );
myServiceDescription->TargetNamespace = "http://tempuri.org/";

// Get the ServiceCollection of the ServiceDescription.
ServiceCollection^ myServiceCollection = myServiceDescription->Services;

// Remove the Service at index 0 of the collection.
myServiceCollection->Remove( myServiceDescription->Services[ 0 ] );
// Read a ServiceDescription from existing WSDL.
ServiceDescription myServiceDescription =
   ServiceDescription.Read("Input_CS.wsdl");
myServiceDescription.TargetNamespace = "http://tempuri.org/";

// Get the ServiceCollection of the ServiceDescription.
ServiceCollection myServiceCollection = myServiceDescription.Services;

// Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services[0]);
' Read a ServiceDescription from existing WSDL.
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read("Input.vb.wsdl")
myServiceDescription.TargetNamespace = "http://tempuri.org/"

' Get the ServiceCollection of the ServiceDescription.
Dim myServiceCollection As ServiceCollection = _
   myServiceDescription.Services

' Remove the Service at index 0 of the collection.
myServiceCollection.Remove(myServiceDescription.Services.Item(0))

Se aplica a

Item[String]

Obtiene un objeto Service especificado por su nombre.

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

Parámetros

name
String

Nombre del objeto Service devuelto.

Valor de propiedad

Service

Objeto Service.

Ejemplos

// Create a new XmlTextWriter with specified URL.
XmlTextReader^ myXmlReader = gcnew XmlTextReader( "All_CS.wsdl" );
ServiceDescription^ myServiceDescription = ServiceDescription::Read( myXmlReader );
myServiceDescription->TargetNamespace = "http://tempuri.org/";

// Remove the service named MathService.
ServiceCollection^ myServiceDescriptionCollection = myServiceDescription->Services;
myServiceDescriptionCollection->Remove( myServiceDescription->Services[ "MathService" ] );
// Create a new XmlTextWriter with specified URL.
XmlTextReader myXmlReader = new XmlTextReader("All_CS.wsdl");
ServiceDescription myServiceDescription =
   ServiceDescription.Read(myXmlReader);
myServiceDescription.TargetNamespace = "http://tempuri.org/";

// Remove the service named MathService.
ServiceCollection myServiceDescriptionCollection =
   myServiceDescription.Services;
myServiceDescriptionCollection.Remove(
   myServiceDescription.Services["MathService"]);
' Create a new XmlTextWriter with specified URL.
Dim myXmlReader As New XmlTextReader("All_VB.wsdl")
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read(myXmlReader)
myServiceDescription.TargetNamespace = "http://tempuri.org/"

' Remove the service named MathService.
Dim myServiceDescriptionCollection As ServiceCollection = _
   myServiceDescription.Services
myServiceDescriptionCollection.Remove( _
   myServiceDescription.Services("MathService"))

Se aplica a