TagPrefixCollection.Item[Int32] プロパティ

定義

指定したインデックス位置の TagPrefixInfo オブジェクトを取得または設定します。

public:
 property System::Web::Configuration::TagPrefixInfo ^ default[int] { System::Web::Configuration::TagPrefixInfo ^ get(int index); void set(int index, System::Web::Configuration::TagPrefixInfo ^ value); };
public System.Web.Configuration.TagPrefixInfo this[int index] { get; set; }
member this.Item(int) : System.Web.Configuration.TagPrefixInfo with get, set
Default Public Property Item(index As Integer) As TagPrefixInfo

パラメーター

index
Int32

TagPrefixInfo オブジェクトの、コレクション内でのインデックス。

プロパティ値

TagPrefixInfo

指定したインデックスに存在する TagPrefixInfo オブジェクト。指定したインデックスにオブジェクトが存在しない場合は null

次のコード例は、Item[] プロパティの使用方法を示しています。 このコード例は、PagesSection クラスのために提供されている大規模な例の一部です。

// Get all current Controls in the collection.
for (int i = 0; i < pagesSection.Controls.Count; i++)
{
  Console.WriteLine("Control {0}:", i);
  Console.WriteLine("  TagPrefix = '{0}' ",
      pagesSection.Controls[i].TagPrefix);
  Console.WriteLine("  TagName = '{0}' ",
      pagesSection.Controls[i].TagName);
  Console.WriteLine("  Source = '{0}' ",
      pagesSection.Controls[i].Source);
  Console.WriteLine("  Namespace = '{0}' ",
      pagesSection.Controls[i].Namespace);
  Console.WriteLine("  Assembly = '{0}' ",
      pagesSection.Controls[i].Assembly);
}
' Get all current Controls in the collection.
Dim j As Int32
For j = 0 To pagesSection.Controls.Count - 1
  Console.WriteLine("Control {0}:", j)
  Console.WriteLine("  TagPrefix = '{0}' ", _
   pagesSection.Controls(j).TagPrefix)
  Console.WriteLine("  TagName = '{0}' ", _
   pagesSection.Controls(j).TagName)
  Console.WriteLine("  Source = '{0}' ", _
   pagesSection.Controls(j).Source)
  Console.WriteLine("  Namespace = '{0}' ", _
   pagesSection.Controls(j).Namespace)
  Console.WriteLine("  Assembly = '{0}' ", _
   pagesSection.Controls(j).Assembly)
Next

注釈

このプロパティは、 TagPrefixInfo 指定したインデックスに既に存在する場合はオブジェクトを上書きします。それ以外の場合は、新しいオブジェクトが作成され、コレクションに追加されます。

適用対象

こちらもご覧ください