This documentation is archived and is not being maintained.
MimeTextMatchCollection::Contains Method
Visual Studio 2008
Returns a value indicating whether the specified MimeTextMatch is a member of the MimeTextMatchCollection.
Assembly: System.Web.Services (in System.Web.Services.dll)
Parameters
- match
- Type: System.Web.Services.Description::MimeTextMatch
The MimeTextMatch for which to check collection membership.
Return Value
Type: System::Booleantrue if the match parameter is a member of the MimeTextMatchCollection; otherwise, false.
The following example demonstrates the use of the Contains method.
// Get an array instance of 'MimeTextMatch' class. array<MimeTextMatch^>^myMimeTextMatch = gcnew array<MimeTextMatch^>(4); myMimeTextMatchCollection = myMimeTextBinding->Matches; // Initialize properties of 'MimeTextMatch' class. for ( myInt = 0; myInt < 4; myInt++ ) { // Create the 'MimeTextMatch' instance. myMimeTextMatch[ myInt ] = gcnew MimeTextMatch; myMimeTextMatch[ myInt ]->Name = "Title"; myMimeTextMatch[ myInt ]->Type = "*/*"; myMimeTextMatch[ myInt ]->IgnoreCase = true; if ( true == myMimeTextMatchCollection->Contains( myMimeTextMatch[ 0 ] ) ) { myMimeTextMatch[ myInt ]->Name = String::Format( "Title{0}", Convert::ToString( myInt ) ); myMimeTextMatch[ myInt ]->Capture = 2; myMimeTextMatch[ myInt ]->Group = 2; myMimeTextMatchCollection->Add( myMimeTextMatch[ myInt ] ); } else { myMimeTextMatchCollection->Add( myMimeTextMatch[ myInt ] ); myMimeTextMatchCollection[ myInt ]->RepeatsString = "2"; } } myMimeTextMatchCollection = myMimeTextBinding->Matches; // Copy collection to 'MimeTextMatch' array instance. myMimeTextMatchCollection->CopyTo( myMimeTextMatch, 0 );
// Get an array instance of 'MimeTextMatch' class.
MimeTextMatch* myMimeTextMatch[] = new MimeTextMatch*[4];
myMimeTextMatchCollection = myMimeTextBinding->Matches;
// Initialize properties of 'MimeTextMatch' class.
for( myInt = 0 ; myInt < 4 ; myInt++ )
{
// Create the 'MimeTextMatch' instance.
myMimeTextMatch[ myInt ] = new MimeTextMatch();
myMimeTextMatch[ myInt ]->Name = S"Title";
myMimeTextMatch[ myInt ]->Type = S"*/*";
myMimeTextMatch[ myInt ]->IgnoreCase = true;
if( true == myMimeTextMatchCollection->Contains( myMimeTextMatch[ 0 ] ) )
{
myMimeTextMatch[ myInt ]->Name = String::Format( S"Title{0}", Convert::ToString(myInt) );
myMimeTextMatch[ myInt ]->Capture = 2;
myMimeTextMatch[ myInt ]->Group = 2;
myMimeTextMatchCollection->Add( myMimeTextMatch[ myInt ] );
}
else
{
myMimeTextMatchCollection->Add( myMimeTextMatch[ myInt ] );
myMimeTextMatchCollection->Item[ myInt ]->RepeatsString = S"2";
}
}
myMimeTextMatchCollection = myMimeTextBinding->Matches;
// Copy collection to 'MimeTextMatch' array instance.
myMimeTextMatchCollection->CopyTo( myMimeTextMatch, 0 );
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: