MimeTextMatchCollection Class
Collapse the table of content
Expand the table of content

MimeTextMatchCollection Class


Provides a collection of instances of the MimeTextMatch class. This class cannot be inherited.

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


public sealed class MimeTextMatchCollection : CollectionBase


Initializes a new instance of the MimeTextMatchCollection class.


Gets or sets the number of elements that the CollectionBase can contain.(Inherited from CollectionBase.)


Gets the number of elements contained in the CollectionBase instance. This property cannot be overridden.(Inherited from CollectionBase.)


Gets or sets the value of the member of the MimeTextMatchCollection at the specified zero-based index.


Adds the specified MimeTextMatch to the end of the MimeTextMatchCollection.


Removes all objects from the CollectionBase instance. This method cannot be overridden.(Inherited from CollectionBase.)


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

System_CAPS_pubmethodCopyTo(MimeTextMatch[], Int32)

Copies the entire MimeTextMatchCollection to a compatible one-dimensional array of type MimeTextMatch, starting at the specified zero-based index of the target array.


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Returns an enumerator that iterates through the CollectionBase instance.(Inherited from CollectionBase.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)


Searches for the specified MimeTextMatch and returns the zero-based index of the first occurrence within the collection.

System_CAPS_pubmethodInsert(Int32, MimeTextMatch)

Adds the specified MimeTextMatch to the MimeTextMatchCollection at the specified index.


Removes the first occurrence of the specified MimeTextMatch from the MimeTextMatchCollection.


Removes the element at the specified index of the CollectionBase instance. This method is not overridable.(Inherited from CollectionBase.)


Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodICollection.CopyTo(Array, Int32)

Copies the entire CollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array.(Inherited from CollectionBase.)


Adds an object to the end of the CollectionBase.(Inherited from CollectionBase.)


Determines whether the CollectionBase contains a specific element.(Inherited from CollectionBase.)


Searches for the specified Object and returns the zero-based index of the first occurrence within the entire CollectionBase.(Inherited from CollectionBase.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Insert(Int32, Object)

Inserts an element into the CollectionBase at the specified index.(Inherited from CollectionBase.)


Removes the first occurrence of a specific object from the CollectionBase.(Inherited from CollectionBase.)


Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)


Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)


Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)


Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

A MimeTextMatch represents a MIME text pattern for which an HTTP transmission will be searched. For more information about specifying protocols for XML Web services, see . For more information about Web Services Description Language (WSDL), see the specification at http://www.w3.org/TR/wsdl/.01DFC27C-C68E-4910-A0AA-5E4C2A766B0C

The following example demonstrates the use of the properties and methods exposed by the MimeTextMatchCollection class.

// Create the 'InputBinding' object.
InputBinding myInputBinding = new InputBinding();
MimeTextBinding myMimeTextBinding = new MimeTextBinding();
MimeTextMatchCollection myMimeTextMatchCollection;
// 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 ] );
      myMimeTextMatchCollection.Add( myMimeTextMatch[ myInt ] );
      myMimeTextMatchCollection[ myInt ].RepeatsString = "2";
myMimeTextMatchCollection = myMimeTextBinding.Matches;
// Copy collection to 'MimeTextMatch' array instance.
myMimeTextMatchCollection.CopyTo( myMimeTextMatch, 0 );
// Add the 'InputBinding' to 'OperationBinding'.
myOperationBinding.Input = myInputBinding;      

// Create the 'OutputBinding' instance.
OutputBinding myOutputBinding = new OutputBinding();
// Create the 'MimeTextBinding' instance.
MimeTextBinding myMimeTextBinding1 = new MimeTextBinding();
// Get an instance of 'MimeTextMatchCollection'.
MimeTextMatchCollection myMimeTextMatchCollection1 = new MimeTextMatchCollection();
MimeTextMatch[] myMimeTextMatch1 = new MimeTextMatch[5];
myMimeTextMatchCollection1 = myMimeTextBinding1.Matches;
for( myInt = 0 ; myInt < 4 ; myInt++ )
   myMimeTextMatch1[ myInt ]  = new MimeTextMatch();
   myMimeTextMatch1[ myInt ].Name = "Title" + Convert.ToString( myInt );
   if( myInt != 0 )
      myMimeTextMatch1[ myInt ].RepeatsString = "7";
   myMimeTextMatchCollection1.Add( myMimeTextMatch1[ myInt ] );
myMimeTextMatch1[4] = new MimeTextMatch();
// Remove 'MimeTextMatch' instance from collection.
myMimeTextMatchCollection1.Remove( myMimeTextMatch1[ 1 ] );
// Using MimeTextMatchCollection.Item indexer to comapre. 
if( myMimeTextMatch1[ 2 ] == myMimeTextMatchCollection1[ 1 ] )
   // Check whether 'MimeTextMatch' instance exists. 
   myInt = myMimeTextMatchCollection1.IndexOf( myMimeTextMatch1[ 2 ] );
   // Insert 'MimeTextMatch' instance at a desired position.
   myMimeTextMatchCollection1.Insert( 1, myMimeTextMatch1[ myInt ] );
   myMimeTextMatchCollection1[ 1 ].RepeatsString = "5";
   myMimeTextMatchCollection1.Insert( 4, myMimeTextMatch1[ myInt ] );

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
© 2015 Microsoft