Export (0) Print
Expand All

MimeTextMatchCollection Class

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

System.Object
  System.Collections.CollectionBase
    System.Web.Services.Description.MimeTextMatchCollection

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

public sealed class MimeTextMatchCollection : CollectionBase

The MimeTextMatchCollection type exposes the following members.

  NameDescription
Public methodMimeTextMatchCollectionInitializes a new instance of the MimeTextMatchCollection class.
Top

  NameDescription
Public propertyCapacityGets or sets the number of elements that the CollectionBase can contain. (Inherited from CollectionBase.)
Public propertyCountGets the number of elements contained in the CollectionBase instance. This property cannot be overridden. (Inherited from CollectionBase.)
Public propertyItemGets or sets the value of the member of the MimeTextMatchCollection at the specified zero-based index.
Top

  NameDescription
Public methodAddAdds the specified MimeTextMatch to the end of the MimeTextMatchCollection.
Public methodClearRemoves all objects from the CollectionBase instance. This method cannot be overridden. (Inherited from CollectionBase.)
Public methodContainsReturns a value indicating whether the specified MimeTextMatch is a member of the MimeTextMatchCollection.
Public methodCopyToCopies the entire MimeTextMatchCollection to a compatible one-dimensional array of type MimeTextMatch, starting at the specified zero-based index of the target array.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetEnumeratorReturns an enumerator that iterates through the CollectionBase instance. (Inherited from CollectionBase.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIndexOfSearches for the specified MimeTextMatch and returns the zero-based index of the first occurrence within the collection.
Public methodInsertAdds the specified MimeTextMatch to the MimeTextMatchCollection at the specified index.
Public methodRemoveRemoves the first occurrence of the specified MimeTextMatch from the MimeTextMatchCollection.
Public methodRemoveAtRemoves the element at the specified index of the CollectionBase instance. This method is not overridable. (Inherited from CollectionBase.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Explicit interface implemetationPrivate methodICollection.CopyToCopies the entire CollectionBase to a compatible one-dimensional Array, starting at the specified index of the target array. (Inherited from CollectionBase.)
Explicit interface implemetationPrivate propertyICollection.IsSynchronizedGets a value indicating whether access to the CollectionBase is synchronized (thread safe). (Inherited from CollectionBase.)
Explicit interface implemetationPrivate propertyICollection.SyncRootGets an object that can be used to synchronize access to the CollectionBase. (Inherited from CollectionBase.)
Explicit interface implemetationPrivate methodIList.AddAdds an object to the end of the CollectionBase. (Inherited from CollectionBase.)
Explicit interface implemetationPrivate methodIList.ContainsDetermines whether the CollectionBase contains a specific element. (Inherited from CollectionBase.)
Explicit interface implemetationPrivate methodIList.IndexOfSearches for the specified Object and returns the zero-based index of the first occurrence within the entire CollectionBase. (Inherited from CollectionBase.)
Explicit interface implemetationPrivate methodIList.InsertInserts an element into the CollectionBase at the specified index. (Inherited from CollectionBase.)
Explicit interface implemetationPrivate propertyIList.IsFixedSizeGets a value indicating whether the CollectionBase has a fixed size. (Inherited from CollectionBase.)
Explicit interface implemetationPrivate propertyIList.IsReadOnlyGets a value indicating whether the CollectionBase is read-only. (Inherited from CollectionBase.)
Explicit interface implemetationPrivate propertyIList.ItemGets or sets the element at the specified index. (Inherited from CollectionBase.)
Explicit interface implemetationPrivate methodIList.RemoveRemoves the first occurrence of a specific object from the CollectionBase. (Inherited from CollectionBase.)
Top

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 [<topic://cpconbuildingaspnetwebservices>]. For more information about Web Services Description Language (WSDL), see the specification at http://www.w3.org/TR/wsdl/.

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

         // Create the 'OutputBinding' instance.
         OutputBinding myOutputBinding = new OutputBinding();
         // Create the 'MimeTextBinding' instance.
         MimeTextBinding myMimeTextBinding1 = new MimeTextBinding();
// <Snippet6> 
         // 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 ] );
         }
// </Snippet8>

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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