MessageCollection.Contains(Message) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 Message이 MessageCollection의 멤버인지 여부를 나타내는 값을 반환합니다.
public:
bool Contains(System::Web::Services::Description::Message ^ message);
public bool Contains (System.Web.Services.Description.Message message);
member this.Contains : System.Web.Services.Description.Message -> bool
Public Function Contains (message As Message) As Boolean
매개 변수
반환
message
매개 변수가 MessageCollection의 멤버이면 true
이고, 그렇지 않으면 false
입니다.
예제
다음 예제에서는 Contains
메서드를 사용하는 방법을 보여 줍니다.
// Get Message by Name = S"AddSoapIn".
Message^ myMessage = myServiceDescription->Messages[ "AddSoapIn" ];
Console::WriteLine( "" );
Console::WriteLine( "Getting Message = 'AddSoapIn' {by Name}" );
if ( myMessageCollection->Contains( myMessage ) )
{
Console::WriteLine( "" );
// Get Message Name = S"AddSoapIn" Index.
Console::WriteLine( "Message 'AddSoapIn' was found in Message Collection." );
Console::WriteLine( "Index of 'AddSoapIn' in Message Collection = {0}", myMessageCollection->IndexOf( myMessage ) );
Console::WriteLine( "Deleting Message from Message Collection..." );
myMessageCollection->Remove( myMessage );
if ( myMessageCollection->IndexOf( myMessage ) == -1 )
Console::WriteLine( "Message 'AddSoapIn' was successfully removed from Message Collection." );
}
// Get Message by Name = "AddSoapIn".
Message myMessage = myServiceDescription.Messages["AddSoapIn"];
Console.WriteLine("");
Console.WriteLine("Getting Message = 'AddSoapIn' {by Name}");
if (myMessageCollection.Contains(myMessage))
{
Console.WriteLine("");
// Get Message Name = "AddSoapIn" Index.
Console.WriteLine("Message 'AddSoapIn' was found in Message Collection.");
Console.WriteLine("Index of 'AddSoapIn' in Message Collection = " + myMessageCollection.IndexOf(myMessage));
Console.WriteLine("Deleting Message from Message Collection...");
myMessageCollection.Remove(myMessage);
if(myMessageCollection.IndexOf(myMessage) == -1)
{
Console.WriteLine("Message 'AddSoapIn' was successfully removed from Message Collection.");
}
}
' Get Message by Name = "AddSoapIn".
Dim myMessage As Message = myServiceDescription.Messages("AddSoapIn")
Console.WriteLine("")
Console.WriteLine("Getting Message = 'AddSoapIn' {by Name}")
If myMessageCollection.Contains(myMessage) Then
Console.WriteLine("")
' Get Message Name = "AddSoapIn" Index.
Console.WriteLine("Message 'AddSoapIn' was found in Message Collection.")
Console.WriteLine("Index of 'AddSoapIn' in Message Collection = " + _
myMessageCollection.IndexOf(myMessage).ToString)
Console.WriteLine("Deleting Message from Message Collection...")
myMessageCollection.Remove(myMessage)
If myMessageCollection.IndexOf(myMessage) = -1 Then
Console.WriteLine("Message 'AddSoapIn' was successfully " + _
" removed from Message Collection.")
End If
End If