MimeTextMatch.Repeats Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene o imposta un valore che indica il numero di volte in cui deve essere eseguita la ricerca.
public:
property int Repeats { int get(); void set(int value); };
public int Repeats { get; set; }
member this.Repeats : int with get, set
Public Property Repeats As Integer
Valore della proprietà
Intero con segno a 32 bit. Il valore predefinito è 1.
Eccezioni
Il valore della proprietà è negativo.
Esempio
// Create an InputBinding.
InputBinding^ myInputBinding = gcnew InputBinding;
MimeTextBinding^ myMimeTextBinding = gcnew MimeTextBinding;
MimeTextMatchCollection^ myMimeTextMatchCollection1 = gcnew MimeTextMatchCollection;
array<MimeTextMatch^>^myMimeTextMatch = gcnew array<MimeTextMatch^>(3);
myMimeTextMatchCollection1 = myMimeTextBinding->Matches;
// Intialize the MimeTextMatch.
for ( myInt = 0; myInt < 3; myInt++ )
{
// Get a new MimeTextMatch.
myMimeTextMatch[ myInt ] = gcnew MimeTextMatch;
// Assign values to properties of the MimeTextMatch.
myMimeTextMatch[ myInt ]->Name = String::Format( "Title{0}", Convert::ToString( myInt ) );
myMimeTextMatch[ myInt ]->Type = "*/*";
myMimeTextMatch[ myInt ]->Pattern = "TITLE>(.*?)<";
myMimeTextMatch[ myInt ]->IgnoreCase = true;
myMimeTextMatch[ myInt ]->Capture = 2;
myMimeTextMatch[ myInt ]->Group = 2;
if ( myInt != 0 )
{
// Assign the Repeats property if the index is not 0.
myMimeTextMatch[ myInt ]->Repeats = 2;
}
else
{
// Assign the RepeatsString property if the index is 0.
myMimeTextMatch[ myInt ]->RepeatsString = "4";
}
myMimeTextMatchCollection1->Add( myMimeTextMatch[ myInt ] );
}
// Create an InputBinding.
InputBinding myInputBinding = new InputBinding();
MimeTextBinding myMimeTextBinding = new MimeTextBinding();
MimeTextMatchCollection myMimeTextMatchCollection1 =
new MimeTextMatchCollection();
MimeTextMatch[] myMimeTextMatch = new MimeTextMatch[3];
myMimeTextMatchCollection1 = myMimeTextBinding.Matches;
// Intialize the MimeTextMatch.
for( myInt = 0 ; myInt < 3 ; myInt++ )
{
// Get a new MimeTextMatch.
myMimeTextMatch[ myInt ] = new MimeTextMatch();
// Assign values to properties of the MimeTextMatch.
myMimeTextMatch[ myInt ].Name = "Title" + Convert.ToString( myInt );
myMimeTextMatch[ myInt ].Type = "*/*";
myMimeTextMatch[ myInt ].Pattern = "TITLE>(.*?)<";
myMimeTextMatch[ myInt ].IgnoreCase = true;
myMimeTextMatch[ myInt ].Capture = 2;
myMimeTextMatch[ myInt ].Group = 2;
if( myInt != 0 )
{
// Assign the Repeats property if the index is not 0.
myMimeTextMatch[ myInt ].Repeats = 2;
}
else
{
// Assign the RepeatsString property if the index is 0.
myMimeTextMatch[ myInt ].RepeatsString = "4";
}
// Add the MimeTextMatch to the collection.
myMimeTextMatchCollection1.Add( myMimeTextMatch[ myInt ] );
}
' Create an InputBinding.
Dim myInputBinding As New InputBinding()
Dim myMimeTextBinding As New MimeTextBinding()
Dim myMimeTextMatchCollection1 As New MimeTextMatchCollection()
Dim myMimeTextMatch(2) As MimeTextMatch
myMimeTextMatchCollection1 = myMimeTextBinding.Matches
' Intialize the MimeTextMatch.
For myInt = 0 To 2
' Get a new MimeTextMatch.
myMimeTextMatch(myInt) = New MimeTextMatch()
' Assign values to properties of the MimeTextMatch.
myMimeTextMatch(myInt).Name = "Title" + Convert.ToString(myInt)
myMimeTextMatch(myInt).Type = "*/*"
myMimeTextMatch(myInt).Pattern = "TITLE>(.*?)<"
myMimeTextMatch(myInt).IgnoreCase = True
myMimeTextMatch(myInt).Capture = 2
myMimeTextMatch(myInt).Group = 2
If myInt <> 0 Then
' Assign the Repeats property if the index is not 0.
myMimeTextMatch(myInt).Repeats = 2
Else
' Assign the RepeatsString property if the index is 0.
myMimeTextMatch(myInt).RepeatsString = "4"
End If
' Add 'MimeTextMatch' instance to collection.
myMimeTextMatchCollection1.Add(myMimeTextMatch(myInt))
Next myInt
Commenti
In un caso in cui sia possibile più corrispondenze, il valore della proprietà 1 restituirà solo la prima corrispondenza trovata. Un valore di MaxValue restituirà tutte le corrispondenze.
Questa proprietà restituisce le stesse informazioni della RepeatsString proprietà, ma come intero con segno a 32 bit anziché come stringa.