MimeTextMatchCollection.CopyTo(MimeTextMatch[], Int32) Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Copia todo el objeto MimeTextMatchCollection en una matriz unidimensional compatible de tipo MimeTextMatch, a partir del índice de base cero especificado de la matriz de destino.
public:
void CopyTo(cli::array <System::Web::Services::Description::MimeTextMatch ^> ^ array, int index);
public void CopyTo (System.Web.Services.Description.MimeTextMatch[] array, int index);
member this.CopyTo : System.Web.Services.Description.MimeTextMatch[] * int -> unit
Public Sub CopyTo (array As MimeTextMatch(), index As Integer)
Parámetros
- array
- MimeTextMatch[]
Matriz de tipo MimeTextMatch que actúa como destino de la operación de copia.
- index
- Int32
Índice de base cero en el que se comienza a insertar la colección copiada.
Ejemplos
En el siguiente ejemplo se muestra el uso del método CopyTo
.
// 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.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 );
' Get an array instance of 'MimeTextMatch' class.
Dim myMimeTextMatch(3) As MimeTextMatch
myMimeTextMatchCollection = myMimeTextBinding.Matches
' Initialize properties of 'MimeTextMatch' class.
For myInt = 0 To 3
' 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)) Then
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"
End If
Next myInt
myMimeTextMatchCollection = myMimeTextBinding.Matches
' Copy collection to 'MimeTextMatch' array instance.
myMimeTextMatchCollection.CopyTo(myMimeTextMatch, 0)