This documentation is archived and is not being maintained.

MimeTextMatchCollection::Item Property

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

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

public:
property MimeTextMatch^ Item[int index] {
	MimeTextMatch^ get (int index);
	void set (int index, MimeTextMatch^ value);
}

Parameters

index
Type: System::Int32

The zero-based index of the MimeTextMatch whose value is returned or modified.

Property Value

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

The following example demonstrates the use of a zero-based index to retrieve a member of the MimeTextMatchCollection.

// Get an instance of 'MimeTextMatchCollection'.
MimeTextMatchCollection^ myMimeTextMatchCollection1 = gcnew MimeTextMatchCollection;
array<MimeTextMatch^>^myMimeTextMatch1 = gcnew array<MimeTextMatch^>(5);
myMimeTextMatchCollection1 = myMimeTextBinding1->Matches;
for ( myInt = 0; myInt < 4; myInt++ )
{
   myMimeTextMatch1[ myInt ] = gcnew MimeTextMatch;
   myMimeTextMatch1[ myInt ]->Name = String::Format( "Title{0}", Convert::ToString( myInt ) );
   if ( myInt != 0 )
   {
      myMimeTextMatch1[ myInt ]->RepeatsString = "7";
   }
   myMimeTextMatchCollection1->Add( myMimeTextMatch1[ myInt ] );
}
myMimeTextMatch1[ 4 ] = gcnew 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 ] );
}
// 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 = String::Format( S"Title{0}", Convert::ToString(myInt) );
   if( myInt != 0 )
   {
      myMimeTextMatch1[ myInt ]->RepeatsString = S"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->Item[ 2 ] == myMimeTextMatchCollection1->Item[ 1 ] )
{
   // Check whether 'MimeTextMatch' instance exists. 
   myInt = myMimeTextMatchCollection1->IndexOf( myMimeTextMatch1[ 2 ] );
   // Insert 'MimeTextMatch' instance at a desired position.
   myMimeTextMatchCollection1->Insert( 1, myMimeTextMatch1[ myInt ] );
   myMimeTextMatchCollection1->Item[ 1 ]->RepeatsString = S"5";
   myMimeTextMatchCollection1->Insert( 4, myMimeTextMatch1[ myInt ] );
}

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.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Show: