MimeTextMatchCollection.Add(MimeTextMatch) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 MimeTextMatch을 MimeTextMatchCollection 끝에 추가합니다.
public:
int Add(System::Web::Services::Description::MimeTextMatch ^ match);
public int Add (System.Web.Services.Description.MimeTextMatch match);
member this.Add : System.Web.Services.Description.MimeTextMatch -> int
Public Function Add (match As MimeTextMatch) As Integer
매개 변수
- match
- MimeTextMatch
컬렉션에 추가할 MimeTextMatch입니다.
반환
match
매개 변수가 추가된 위치의 인덱스(0부터 시작)입니다.
예제
다음 예제에서는 Add
메서드를 사용하는 방법을 보여 줍니다.
// 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)