SiteMapNodeCollection.Item プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As SiteMapNodeCollection Dim index As Integer Dim value As SiteMapNode value = instance(index) instance(index) = value
public: virtual property SiteMapNode^ default [int] { SiteMapNode^ get (int index); void set (int index, SiteMapNode^ value); }
/** @property */ public SiteMapNode get_Item (int index) /** @property */ public void set_Item (int index, SiteMapNode value)
プロパティ値
SiteMapNodeCollection の要素を表す SiteMapNode。


Item インデクサを使用して、SiteMapNodeCollection コレクションの内容を反復処理したり、指定したインデックス位置にある SiteMapNode オブジェクトを置き換えたりできます。

Item インデクサを使用して、SiteMapNode オブジェクトを SiteMapNodeCollection コレクションから取得する方法を次のコード例に示します。この例では、SiteMapNode オブジェクトが、Remove メソッドを使用して内部配列の第 2 要素の位置から削除され、Add メソッドを使用して配列の末尾に追加されます。SiteMapNode オブジェクトを、配列の末尾に追加するのではなく、特定のインデックス位置に挿入するには、Insert メソッドを使用します。
' Move a node from one spot in the list to another. Try Response.Write("Original node order: <BR>") Dim node As SiteMapNode For Each node In nodes Response.Write( node.Title & "<BR>") Next Dim aNode As SiteMapNode = nodes(1) Response.Write("Adding " & aNode.Title & " to the end of the collection.<BR>") nodes.Add(aNode) Response.Write("Removing " & aNode.Title & " at position 1. <BR>") nodes.Remove(nodes(1)) Response.Write("New node order: <BR>") For Each node In nodes Response.Write( node.Title & "<BR>") Next Catch nse As NotSupportedException Response.Write("NotSupportedException caught.<BR>") End Try
// Move a node from one spot in the list to another. try { Response.Write("Original node order: <BR>"); foreach (SiteMapNode node in nodes) { Response.Write( node.Title + "<BR>"); } SiteMapNode aNode = nodes[1]; Response.Write("Adding " + aNode.Title + " to the end of the collection.<BR>"); nodes.Add(aNode); Response.Write("Removing " + aNode.Title + " at position 1. <BR>"); nodes.Remove(nodes[1]); Response.Write("New node order: <BR>"); foreach (SiteMapNode node in nodes) { Response.Write( node.Title + "<BR>"); } } catch (NotSupportedException nse) { Response.Write("NotSupportedException caught.<BR>"); }

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からSiteMapNodeCollection.Item プロパティを検索する場合は、下記のリンクをクリックしてください。

- SiteMapNodeCollection.Item プロパティのページへのリンク