Compartilhar via


ServiceDescriptionFormatExtensionCollection.Contains(Object) Método

Definição

Retorna um valor que indica se o ServiceDescriptionFormatExtension especificado é um membro do 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

Parâmetros

extension
Object

O ServiceDescriptionFormatExtension para o qual a associação da coleção é verificada.

Retornos

true se o ServiceDescriptionFormatExtension é um membro da coleção; caso contrário, false.

Exemplos

// 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

Aplica-se a