다음을 통해 공유


ServiceDescriptionFormatExtensionCollection.Contains(Object) 메서드

정의

지정된 ServiceDescriptionFormatExtensionServiceDescriptionFormatExtensionCollection의 멤버인지 여부를 나타내는 값을 반환합니다.

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

매개 변수

extension
Object

컬렉션 멤버인지 확인할 ServiceDescriptionFormatExtension입니다.

반환

Boolean

ServiceDescriptionFormatExtension이 컬렉션의 멤버이면 true이고, 그렇지 않으면 false입니다.

예제

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

적용 대상