SiteMapNodeCollection.ReadOnly メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SiteMapNodeCollection.ReadOnly メソッドの意味・解説 

SiteMapNodeCollection.ReadOnly メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

指定した SiteMapNodeCollection コレクションノード格納されている読み取り専用コレクション返します

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

Public Shared Function ReadOnly
 ( _
    collection As SiteMapNodeCollection _
) As SiteMapNodeCollection
Dim collection As SiteMapNodeCollection
Dim returnValue As SiteMapNodeCollection

returnValue = SiteMapNodeCollection.ReadOnly(collection)
public static SiteMapNodeCollection ReadOnly
 (
    SiteMapNodeCollection collection
)
public:
static SiteMapNodeCollection^ ReadOnly (
    SiteMapNodeCollection^ collection
)
public static SiteMapNodeCollection ReadOnly
 (
    SiteMapNodeCollection collection
)
public static function ReadOnly
 (
    collection : SiteMapNodeCollection
) : SiteMapNodeCollection

パラメータ

collection

読み取り専用 SiteMapNodeCollection に追加する SiteMapNode オブジェクト格納している SiteMapNodeCollection

戻り値
元の SiteMapNodeCollection と同じ SiteMapNode 要素および構造を持つ読み取り専用 SiteMapNodeCollection

例外例外
例外種類条件

ArgumentNullException

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

解説解説

IsReadOnly プロパティチェックすることにより、SiteMapNodeCollection コレクション読み取り専用であるかどうかテストできます。IsFixedSize プロパティは、SiteMapNodeCollection読み取り専用場合にも true返します

実装時の注意 読み取り専用 SiteMapNodeCollection コレクションは、読み取り操作および検索操作サポートしますが、Add、AddRange、ClearInsertRemove、RemoveAt の各メソッド、および既定インデクサ プロパティ Item設定側をサポートしません。

使用例使用例

IsReadOnly プロパティ使用して SiteMapNodeCollection コレクション読み取り専用変更可能かをテストする方法次のコード例示しますsiteNodes変更可能の場合、それに対して MoveNode呼び出されます。それ以外場合siteNodesベースとして SiteMapNodeCollection作成されます。

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 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からSiteMapNodeCollection.ReadOnly メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からSiteMapNodeCollection.ReadOnly メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からSiteMapNodeCollection.ReadOnly メソッド を検索

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

辞書ショートカット

すべての辞書の索引

SiteMapNodeCollection.ReadOnly メソッドのお隣キーワード
検索ランキング

   

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



SiteMapNodeCollection.ReadOnly メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS