MimeTextMatchCollection.Contains Method (MimeTextMatch)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns a value indicating whether the specified MimeTextMatch is a member of the MimeTextMatchCollection.

Namespace:   System.Web.Services.Description
Assembly:  System.Web.Services (in System.Web.Services.dll)

public bool Contains(
	MimeTextMatch match
)

Parameters

match
Type: System.Web.Services.Description.MimeTextMatch

The MimeTextMatch for which to check collection membership.

Return Value

Type: System.Boolean

true 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.
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 = "Title";
   myMimeTextMatch[ myInt ].Type = "*/*";
   myMimeTextMatch[ myInt ].IgnoreCase = true;

   if(  true == myMimeTextMatchCollection.Contains( myMimeTextMatch[ 0 ] ) )
   {
      myMimeTextMatch[ myInt ].Name = "Title" + 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 );

.NET Framework
Available since 1.1
Return to top
Show: