言語

NamespaceCollection.Item[Int32] プロパティ

定義

コレクション内の指定したインデックス位置にある NamespaceInfo オブジェクトを取得または設定します。

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

パラメーター

index
Int32

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

プロパティ値

NamespaceInfo 指定したインデックス位置にあるオブジェクト。または、そのインデックスにオブジェクトがない場合は null

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

// Get all current Namespaces in the collection.
for (int i = 0; i < pagesSection.Namespaces.Count; i++)
{
  Console.WriteLine(
      "Namespaces {0}: '{1}'", i,
      pagesSection.Namespaces[i].Namespace);
}
' Get all current Namespaces in the collection.
Dim i As Int16
For i = 0 To pagesSection.Namespaces.Count - 1
  Console.WriteLine( _
   "Namespaces {0}: '{1}'", i, _
   pagesSection.Namespaces(i).Namespace)
Next

注釈

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

適用対象

こちらもご覧ください