Freigeben über


ServiceDescriptionFormatExtensionCollection.Contains-Methode

Gibt einen Wert zurück, der angibt, ob die angegebene ServiceDescriptionFormatExtension ein Member der ServiceDescriptionFormatExtensionCollection ist.

Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)

Syntax

'Declaration
Public Function Contains ( _
    extension As Object _
) As Boolean
'Usage
Dim instance As ServiceDescriptionFormatExtensionCollection
Dim extension As Object
Dim returnValue As Boolean

returnValue = instance.Contains(extension)
public bool Contains (
    Object extension
)
public:
bool Contains (
    Object^ extension
)
public boolean Contains (
    Object extension
)
public function Contains (
    extension : Object
) : boolean

Parameter

Rückgabewert

true, wenn der extension-Parameter ein Member der Auflistung ist, andernfalls false.

Beispiel

' Check for 'myFormatExtension' object in collection.
If myCollection.Contains(myFormatExtensionObject) Then
   ' Get index of a 'myFormatExtension' object in collection.
   Console.WriteLine("Index of 'myFormatExtensionObject' is " + _
        "{0} in collection.", myCollection.IndexOf(myFormatExtensionObject).ToString())
   ' Remove 'myFormatExtensionObject' element from collection.
   myCollection.Remove(myFormatExtensionObject)
   Console.WriteLine("'myFormatExtensionObject' is removed" + _
        " from collection.")
End If
// Check for 'myFormatExtension' object in collection.
if(myCollection.Contains(myFormatExtensionObject))
{
   // Get index of a 'myFormatExtension' object in collection.
   Console.WriteLine("Index of 'myFormatExtensionObject' is "+
      "{0} in collection.",
      myCollection.IndexOf(myFormatExtensionObject).ToString());
   // Remove 'myFormatExtensionObject' element from collection.
   myCollection.Remove(myFormatExtensionObject);
   Console.WriteLine("'myFormatExtensionObject' is removed"+
                     " from collection.");
}
// Check for 'myFormatExtension' object in collection.
if ( myCollection->Contains( myFormatExtensionObject ) )
{
   // Get index of a 'myFormatExtension' object in collection.
   Console::WriteLine( "Index of 'myFormatExtensionObject' is {0} in collection.", myCollection->IndexOf( myFormatExtensionObject ) );

   // Remove 'myFormatExtensionObject' element from collection.
   myCollection->Remove( myFormatExtensionObject );
   Console::WriteLine( "'myFormatExtensionObject' is removed  from collection." );
}
// Check for 'myFormatExtension' object in collection.
if (myCollection.Contains(myFormatExtensionObject)) {
    // Get index of a 'myFormatExtension' object in collection.
    Console.WriteLine("Index of 'myFormatExtensionObject' is " + 
        "{0} in collection.", System.Convert.ToString(myCollection.
        IndexOf(myFormatExtensionObject)));
    
    // Remove 'myFormatExtensionObject' element from collection.
    myCollection.Remove(myFormatExtensionObject);
    Console.WriteLine("'myFormatExtensionObject' is removed" 
        + " from collection.");
}

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

ServiceDescriptionFormatExtensionCollection-Klasse
ServiceDescriptionFormatExtensionCollection-Member
System.Web.Services.Description-Namespace