ServiceCollection.IndexOf(Service) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Belirtilen Service öğesini arar ve içindeki ilk oluşumun sıfır tabanlı dizinini ServiceCollection
döndürür.
public:
int IndexOf(System::Web::Services::Description::Service ^ service);
public int IndexOf (System.Web.Services.Description.Service service);
member this.IndexOf : System.Web.Services.Description.Service -> int
Public Function IndexOf (service As Service) As Integer
Parametreler
Döndürülenler
32 bit imzalı tamsayı.
Örnekler
if ( myServiceDescription->Services->Contains( myService ) )
{
Console::WriteLine( "The mentioned service exists at index {0} in the WSDL.", myServiceDescription->Services->IndexOf( myService ) );
array<Service^>^myServiceArray = gcnew array<Service^>(myServiceDescription->Services->Count);
// Copy the services into an array.
myServiceDescription->Services->CopyTo( myServiceArray, 0 );
IEnumerator^ myEnumerator = myServiceArray->GetEnumerator();
Console::WriteLine( "The names of services in the array are" );
while ( myEnumerator->MoveNext() )
{
Service^ myService1 = dynamic_cast<Service^>(myEnumerator->Current);
Console::WriteLine( myService1->Name );
}
}
else
{
Console::WriteLine( "Service does not exist in the WSDL." );
}
if(myServiceDescription.Services.Contains(myService))
{
Console.WriteLine(
"The mentioned service exists at index {0} in the WSDL.",
myServiceDescription.Services.IndexOf(myService));
Service[] myServiceArray =
new Service[myServiceDescription.Services.Count];
// Copy the services into an array.
myServiceDescription.Services.CopyTo(myServiceArray,0);
IEnumerator myEnumerator = myServiceArray.GetEnumerator();
Console.WriteLine("The names of services in the array are");
while(myEnumerator.MoveNext())
{
Service myService1 = (Service)myEnumerator.Current;
Console.WriteLine(myService1.Name);
}
}
else
{
Console.WriteLine("Service does not exist in the WSDL." );
}
If myServiceDescription.Services.Contains(myService) Then
Console.WriteLine( _
"The mentioned service Exists at index {0} in the WSDL.", _
myServiceDescription.Services.IndexOf(myService))
Dim myServiceArray(myServiceDescription.Services.Count - 1) _
As Service
' Copy the services into an array.
myServiceDescription.Services.CopyTo(myServiceArray, 0)
Dim myEnumerator As IEnumerator = myServiceArray.GetEnumerator()
Console.WriteLine("The names of services in the array are")
While myEnumerator.MoveNext()
Dim myService1 As Service = CType(myEnumerator.Current, Service)
Console.WriteLine(myService1.Name)
End While
Else
Console.WriteLine("Service does not exist in the WSDL.")
End If