Udostępnij za pośrednictwem


ServiceDescriptionFormatExtensionCollection.Contains(Object) Metoda

Definicja

Zwraca wartość wskazującą, czy określony ServiceDescriptionFormatExtension element jest elementem członkowskim elementu ServiceDescriptionFormatExtensionCollection.

public:
 bool Contains(System::Object ^ extension);
public bool Contains (object extension);
member this.Contains : obj -> bool
Public Function Contains (extension As Object) As Boolean

Parametry

extension
Object

Element ServiceDescriptionFormatExtension , dla którego należy sprawdzić członkostwo w kolekcji.

Zwraca

true jeśli element ServiceDescriptionFormatExtension jest członkiem kolekcji; falsew przeciwnym razie .

Przykłady

// 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.",
      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) 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

Dotyczy