SiteMapNodeCollection コンストラクタ ()とは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SiteMapNodeCollection コンストラクタ ()の意味・解説 

SiteMapNodeCollection コンストラクタ ()

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

SiteMapNodeCollection クラス新しインスタンス初期化します。これが既定インスタンスです。

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As New SiteMapNodeCollection
public SiteMapNodeCollection ()
public:
SiteMapNodeCollection ()
public SiteMapNodeCollection ()
public function SiteMapNodeCollection ()
解説解説

SiteMapNodeCollection コンストラクタ使用して、空の SiteMapNodeCollection コレクション作成しますAdd、AddRange、または Insert の各メソッド使用して要素SiteMapNodeCollection追加できます

使用例使用例

SiteMapNodeCollection コンストラクタ使用して新しSiteMapNodeCollection コレクション作成しAdd メソッド使用して要素SiteMapNodeCollection追加する方法次のコード例示します

' The LoadSiteMapData() Function loads site navigation
' data from persistent storage into a DataTable.

Dim siteMapData As DataTable
siteMapData = LoadSiteMapData()

' Create a SiteMapNodeCollection.
Dim nodes As New SiteMapNodeCollection()

' Create a SiteMapNode and add it to the collection.
Dim tempNode As SiteMapNode
Dim row As DataRow
Dim index As Integer
index = 0

While (index < siteMapData.Rows.Count)

    row = siteMapData.Rows(index)

    ' Create a node based on the data in the DataRow.
    tempNode = New SiteMapNode(SiteMap.Provider, row("Key").ToString(),
 row("Url").ToString())

    ' Add the node to the collection.
    nodes.Add(tempNode)
    index = index + 1
End While

// The LoadSiteMapData() method loads site navigation
// data from persistent storage into a DataTable.
DataTable siteMap = LoadSiteMapData();

// Create a SiteMapNodeCollection.
SiteMapNodeCollection nodes = new SiteMapNodeCollection();

// Create a SiteMapNode and add it to the collection.
SiteMapNode tempNode;
DataRow row;
int index = 0;

while (index < siteMap.Rows.Count)
{

    row = siteMap.Rows[index];

    // Create a node based on the data in the DataRow.
    tempNode = new SiteMapNode(SiteMap.Provider,
                                row["Key"].ToString(),
                                row["Url"].ToString());

    // Add the node to the collection.
    nodes.Add(tempNode);
    ++index;
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SiteMapNodeCollection クラス
SiteMapNodeCollection メンバ
System.Web 名前空間
SiteMapNodeCollection

SiteMapNodeCollection コンストラクタ (SiteMapNode)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

SiteMapNodeCollection クラス新しインスタンス初期化してSiteMapNode オブジェクトコレクションの InnerList プロパティ追加します

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    value As SiteMapNode _
)
Dim value As SiteMapNode

Dim instance As New SiteMapNodeCollection(value)
public SiteMapNodeCollection (
    SiteMapNode value
)
public:
SiteMapNodeCollection (
    SiteMapNode^ value
)
public SiteMapNodeCollection (
    SiteMapNode value
)
public function SiteMapNodeCollection (
    value : SiteMapNode
)

パラメータ

value

SiteMapNodeCollection に追加する SiteMapNode。

例外例外
例外種類条件

ArgumentNullException

valuenull 参照 (Visual Basic では Nothing) です。

解説解説

SiteMapNodeCollection コンストラクタ使用して単一初期 SiteMapNode オブジェクトを持つ SiteMapNodeCollection コレクション作成しますAdd、AddRange、または Insert の各メソッド使用して要素SiteMapNodeCollection追加できます

使用例使用例

単一初期 SiteMapNode オブジェクトを持つ SiteMapNodeCollection コレクション作成し、AddRange メソッド使用して、それに SiteMapNode オブジェクトSiteMapNodeCollection追加する方法次のコード例示します個々SiteMapNode オブジェクト読み取り専用でも、SiteMapNodeCollection変更できます

' Create a SiteMapNodeCollection with all the nodes
' from the first two hierarchical levels of the current
' site map.
Dim baseCollection As SiteMapNodeCollection
baseCollection = New SiteMapNodeCollection(SiteMap.RootNode)

Dim childCollection As SiteMapNodeCollection
 = SiteMap.RootNode.ChildNodes

baseCollection.AddRange(childCollection)

Response.Write( "<BR>Derived SiteMapNodeCollection.<BR><HR><BR>")

For Each node In baseCollection
    Response.Write( node.Title + "<BR>")
Next

// Create a SiteMapNodeCollection with all the nodes
// from the first two hierarchical levels of the current
// site map.
SiteMapNodeCollection baseCollection =
    new SiteMapNodeCollection(SiteMap.RootNode);

SiteMapNodeCollection childCollection =
    SiteMap.RootNode.ChildNodes;

baseCollection.AddRange(childCollection);

Response.Write( "<BR>Derived SiteMapNodeCollection.<BR><HR><BR>");
foreach (SiteMapNode node in baseCollection)
 {
    Response.Write( node.Title + "<BR>");
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SiteMapNodeCollection クラス
SiteMapNodeCollection メンバ
System.Web 名前空間
SiteMapNode クラス

SiteMapNodeCollection コンストラクタ (SiteMapNodeCollection)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

SiteMapNodeCollection クラス新しインスタンス初期化して指定した SiteMapNodeCollection コレクションリスト項目をすべてコレクションの InnerList プロパティ追加します

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    value As SiteMapNodeCollection _
)
Dim value As SiteMapNodeCollection

Dim instance As New SiteMapNodeCollection(value)
public SiteMapNodeCollection (
    SiteMapNodeCollection value
)
public:
SiteMapNodeCollection (
    SiteMapNodeCollection^ value
)
public SiteMapNodeCollection (
    SiteMapNodeCollection value
)
public function SiteMapNodeCollection (
    value : SiteMapNodeCollection
)

パラメータ

value

現在の SiteMapNodeCollection に追加する SiteMapNode を格納している SiteMapNodeCollection

例外例外
例外種類条件

ArgumentNullException

valuenull 参照 (Visual Basic では Nothing) です。

解説解説

SiteMapNodeCollection コンストラクタ使用することは、SiteMapNodeCollection コンストラクタ呼び出し、AddRange メソッド使用して要素SiteMapNodeCollection コレクション追加することと等価です。

使用例使用例

SiteMapNodeCollection コレクションを、SiteMapNode オブジェクト別の SiteMapNodeCollectionベースとして使用して作成する方法次のコード例示します。SiteMapNode.GetAllNodes メソッド読み取り専用SiteMapNodeCollection返します。これは、IsReadOnly プロパティtrue返す場合検出されます。新しSiteMapNodeCollection読み取り専用SiteMapNodeCollection使用して作成されAdd メソッドおよび Remove メソッド正常に呼び出されます。

Dim siteNodes As SiteMapNodeCollection
siteNodes = SiteMap.RootNode.GetAllNodes()

If siteNodes.IsReadOnly Or siteNodes.IsFixedSize
 Then

    Response.Write("Collection is read-only or has fixed size.<BR>")

    ' Create a new, modifiable collection from the existing one.
    Dim modifiableCollection As SiteMapNodeCollection
    modifiableCollection = New SiteMapNodeCollection(siteNodes)

    ' The MoveNode example method moves a node from position one to
    ' the last position in the collection.
    MoveNode(modifiableCollection)
Else
    MoveNode(siteNodes)
End If

SiteMapNodeCollection siteNodes = SiteMap.RootNode.GetAllNodes();

if ( siteNodes.IsReadOnly ||
     siteNodes.IsFixedSize )
{
    Response.Write("Collection is read-only or has fixed size.<BR>");

    // Create a new, modifiable collection from the existing one.
    SiteMapNodeCollection modifiableCollection =
         new SiteMapNodeCollection(siteNodes);

    // The MoveNode example method moves a node from position one to
    // the last position in the collection.
    MoveNode(modifiableCollection);
}
else {
    MoveNode(siteNodes);
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SiteMapNodeCollection クラス
SiteMapNodeCollection メンバ
System.Web 名前空間

SiteMapNodeCollection コンストラクタ (Int32)

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

指定した初期量を使用してSiteMapNodeCollection クラス新しインスタンス初期化します。

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文構文

public SiteMapNodeCollection (
    int capacity
)
public:
SiteMapNodeCollection (
    int capacity
)
public SiteMapNodeCollection (
    int capacity
)
public function SiteMapNodeCollection (
    capacity : int
)

パラメータ

capacity

SiteMapNodeCollection の初期量。

解説解説

SiteMapNodeCollection コンストラクタ使用してSiteMapNodeCollection コレクション指定した初期量で作成します

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SiteMapNodeCollection クラス
SiteMapNodeCollection メンバ
System.Web 名前空間
Capacity

SiteMapNodeCollection コンストラクタ

SiteMapNodeCollection クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
SiteMapNodeCollection () SiteMapNodeCollection クラス新しインスタンス初期化します。これが既定インスタンスです。
SiteMapNodeCollection (Int32) 指定した初期量を使用してSiteMapNodeCollection クラス新しインスタンス初期化します。
SiteMapNodeCollection (SiteMapNode) SiteMapNodeCollection クラス新しインスタンス初期化して、SiteMapNode オブジェクトコレクションの InnerList プロパティ追加します
SiteMapNodeCollection (SiteMapNode[]) SiteMapNodeCollection クラス新しインスタンス初期化してSiteMapNode 型の配列コレクションInnerList プロパティ追加します
SiteMapNodeCollection (SiteMapNodeCollection) SiteMapNodeCollection クラス新しインスタンス初期化して指定した SiteMapNodeCollection コレクションリスト項目をすべてコレクションInnerList プロパティ追加します
参照参照

関連項目

SiteMapNodeCollection クラス
SiteMapNodeCollection メンバ
System.Web 名前空間
SiteMapNodeCollection

SiteMapNodeCollection コンストラクタ (SiteMapNode[])

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

SiteMapNodeCollection クラス新しインスタンス初期化してSiteMapNode 型の配列コレクションの InnerList プロパティ追加します

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Sub New ( _
    value As SiteMapNode() _
)
Dim value As SiteMapNode()

Dim instance As New SiteMapNodeCollection(value)
public SiteMapNodeCollection (
    SiteMapNode[] value
)
public:
SiteMapNodeCollection (
    array<SiteMapNode^>^ value
)
public SiteMapNodeCollection (
    SiteMapNode[] value
)
public function SiteMapNodeCollection (
    value : SiteMapNode[]
)

パラメータ

value

SiteMapNodeCollection に追加する SiteMapNode 型の配列

例外例外
例外種類条件

ArgumentNullException

valuenull 参照 (Visual Basic では Nothing) です。

解説解説

SiteMapNodeCollection コンストラクタ使用することは、SiteMapNodeCollection コンストラクタ呼び出し、AddRange メソッド使用して要素SiteMapNodeCollection コレクション追加することと等価です。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SiteMapNodeCollection クラス
SiteMapNodeCollection メンバ
System.Web 名前空間
SiteMapNode クラス



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「SiteMapNodeCollection コンストラクタ ()」の関連用語

SiteMapNodeCollection コンストラクタ ()のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



SiteMapNodeCollection コンストラクタ ()のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS