다음을 통해 공유


MimePartCollection.Contains(MimePart) 메서드

정의

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

public:
 bool Contains(System::Web::Services::Description::MimePart ^ mimePart);
public bool Contains (System.Web.Services.Description.MimePart mimePart);
member this.Contains : System.Web.Services.Description.MimePart -> bool
Public Function Contains (mimePart As MimePart) As Boolean

매개 변수

mimePart
MimePart

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

반환

Boolean

mimePart 매개 변수가 MimePartCollection의 멤버이면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는의 일반적인 용도 Contains 메서드.

MimePart^ myMimePart2 = gcnew MimePart;
MimeXmlBinding^ myMimeXmlBinding2 = gcnew MimeXmlBinding;
myMimeXmlBinding2->Part = "body";
myMimePart2->Extensions->Add( myMimeXmlBinding2 );

// Add a mimepart to the mimepartcollection.
myMimePartCollection->Add( myMimePart2 );
Console::WriteLine( "Adding a mimepart object..." );

// Check if collection contains added mimepart object.
if ( myMimePartCollection->Contains( myMimePart2 ) )
   Console::WriteLine( "'MimePart' is successfully added at position: {0}", myMimePartCollection->IndexOf( myMimePart2 ) );
MimePart myMimePart2=new MimePart();
MimeXmlBinding myMimeXmlBinding2 = new MimeXmlBinding();
myMimeXmlBinding2.Part = "body";
myMimePart2.Extensions.Add(myMimeXmlBinding2);
// Add a mimepart to the mimepartcollection.
myMimePartCollection.Add(myMimePart2);
Console.WriteLine("Adding a mimepart object...");
// Check if collection contains added mimepart object.
if(myMimePartCollection.Contains(myMimePart2))
{
   Console.WriteLine("'MimePart' is successfully added at position: "
                        +myMimePartCollection.IndexOf(myMimePart2));
}
Dim myMimePart2 As New MimePart()
Dim myMimeXmlBinding2 As New MimeXmlBinding()
myMimeXmlBinding2.Part = "body"
myMimePart2.Extensions.Add(myMimeXmlBinding2)
' Add a mimepart to the mimepartcollection.
myMimePartCollection.Add(myMimePart2)
Console.WriteLine("Adding a mimepart object...")
' Check if collection contains added mimepart object.
If myMimePartCollection.Contains(myMimePart2) Then
   Console.WriteLine("'MimePart' is successfully added at position: " + _
                  myMimePartCollection.IndexOf(myMimePart2).ToString())
End If

적용 대상