MimeTextMatchCollection.CopyTo Method
.NET Framework 3.0
Copies the entire MimeTextMatchCollection to a compatible one-dimensional array of type MimeTextMatch, starting at the specified zero-based index of the target array.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
Assembly: System.Web.Services (in system.web.services.dll)
public void CopyTo ( MimeTextMatch[] array, int index )
public function CopyTo ( array : MimeTextMatch[], index : int )
Not applicable.
Parameters
- array
The array of type MimeTextMatch serving as the destination for the copy action.
- index
The zero-based index at which to start placing the copied collection.
The following example demonstrates the use of the CopyTo 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.get_Matches();
// Initialize properties of 'MimeTextMatch' class.
for (myInt = 0; myInt < 4; myInt++) {
// Create the 'MimeTextMatch' instance.
myMimeTextMatch.set_Item(myInt, new MimeTextMatch());
((MimeTextMatch)myMimeTextMatch.get_Item(myInt)).
set_Name("Title");
((MimeTextMatch)myMimeTextMatch.get_Item(myInt)).
set_Type("*/*");
((MimeTextMatch)myMimeTextMatch.get_Item(myInt)).
set_IgnoreCase(true);
if (true == myMimeTextMatchCollection.
Contains(myMimeTextMatch.get_Item(0))) {
((MimeTextMatch)myMimeTextMatch.get_Item(myInt)).
set_Name("Title" + Convert.ToString(myInt));
((MimeTextMatch)myMimeTextMatch.get_Item(myInt)).
set_Capture(2);
((MimeTextMatch)myMimeTextMatch.get_Item(myInt)).
set_Group(2);
myMimeTextMatchCollection.Add(myMimeTextMatch.
get_Item(myInt));
}
else {
myMimeTextMatchCollection.Add(myMimeTextMatch.
get_Item(myInt));
((MimeTextMatch)myMimeTextMatchCollection.get_Item(myInt)).
set_RepeatsString("2");
}
}
myMimeTextMatchCollection = myMimeTextBinding.get_Matches();
// Copy collection to 'MimeTextMatch' array instance.
myMimeTextMatchCollection.CopyTo(myMimeTextMatch, 0);
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: