MimeTextMatchCollection.Item[Int32] プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
指定した 0 から始まるインデックス番号に対応する MimeTextMatchCollection のメンバーの値を取得または設定します。
public:
property System::Web::Services::Description::MimeTextMatch ^ default[int] { System::Web::Services::Description::MimeTextMatch ^ get(int index); void set(int index, System::Web::Services::Description::MimeTextMatch ^ value); };
public System.Web.Services.Description.MimeTextMatch this[int index] { get; set; }
member this.Item(int) : System.Web.Services.Description.MimeTextMatch with get, set
Default Public Property Item(index As Integer) As MimeTextMatch
パラメーター
- index
- Int32
変更または返される値を持つ MimeTextMatch に対応する、0 から始まるインデックス番号。
プロパティ値
MimeTextMatch
。
例
次の例では、0 から始まるインデックスを使用して のメンバーを取得する方法を 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 = "Title" + Convert.ToString( myInt );
if( myInt != 0 )
{
myMimeTextMatch1[ myInt ].RepeatsString = "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[ 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'.
Dim myMimeTextMatchCollection1 As New MimeTextMatchCollection()
Dim myMimeTextMatch1(4) As MimeTextMatch
myMimeTextMatchCollection1 = myMimeTextBinding1.Matches
For myInt = 0 To 3
myMimeTextMatch1(myInt) = New MimeTextMatch()
myMimeTextMatch1(myInt).Name = "Title" + Convert.ToString(myInt)
If myInt <> 0 Then
myMimeTextMatch1(myInt).RepeatsString = "7"
End If
myMimeTextMatchCollection1.Add(myMimeTextMatch1(myInt))
Next myInt
myMimeTextMatch1(4) = New MimeTextMatch()
' Remove 'MimeTextMatch' instance from collection.
myMimeTextMatchCollection1.Remove(myMimeTextMatch1(1))
' Using MimeTextMatchCollection.Item indexer to comapre.
If myMimeTextMatch1(2) Is myMimeTextMatchCollection1(1) Then
' 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))
End If
適用対象
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
.NET