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

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

EditorPartCollection コンストラクタ (ICollection)

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

EditorPart コントロールICollection コレクションを渡すことによって、EditorPartCollection クラス新しインスタンス初期化します。

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

Public Sub New ( _
    editorParts As ICollection _
)
Dim editorParts As ICollection

Dim instance As New EditorPartCollection(editorParts)
public EditorPartCollection (
    ICollection editorParts
)
public:
EditorPartCollection (
    ICollection^ editorParts
)
public EditorPartCollection (
    ICollection editorParts
)
public function EditorPartCollection (
    editorParts : ICollection
)

パラメータ

editorParts

EditorPart コントロールの ICollection。

解説解説

EditorPartCollection コンストラクタは、EditorPartCollection クラスインスタンス初期化しEditorPart コントロールコレクション渡します。これは、新しEditorPartCollection オブジェクトの作成とそれに対すEditorPart コントロール追加使用できる、EditorPartCollection コンストラクタオーバーロード1 つです。

コンストラクタによって作成されEditorPartCollection インスタンス読み取り専用であってもコレクション内の個別EditorPart コントロールプログラムによってアクセスし、そのプロパティおよびメソッド呼び出すことはできます

EditorPartCollection コンストラクタは、一般的にEditorPart コントロール全体セットに対して内容外観、または関連するコントロール グループ位置変更などのバッチ操作を行う場合使用されます。

他に EditorPartCollection コンストラクタは、カスタム EditorPart コントロール開発でも、このカスタム コントロールサーバー コントロール関連付けユーザー各自コントロールカスタム プロパティ編集できるようにする場合によく使用されます。このシナリオでは、サーバー コントロールは、IWebEditable インターフェイス実装する必要がありますまた、そのタスク一部として、CreateEditorParts メソッド実装する必要があります。そのメソッドでは、カスタム EditorPart コントロールサーバー コントロール編集できるように、EditorPart コントロールを、ArrayList オブジェクトなどの ICollection インスタンス追加する必要があります次にEditorPart コントロールコレクションを EditorPartCollection コンストラクタ渡して新しEditorPartCollection オブジェクト作成できます。EditorZoneBase ゾーンは、これを使用してすべてのコントロール設定し編集プロセス開始します

使用例使用例

カスタム EditorPartCollection作成しコレクション読み取り専用場合でも、コレクション内の個別EditorPart コントロール変更するバッチ操作実行する方法次のコード例示します例の実行必要なコード全体については、EditorPartCollection クラス概要で「例」を参照してください

Button1_Click イベント内のコードは、ArrayList オブジェクト作成しページ内の 3 つの EditorPart コントロールのうち 2 つオブジェクト追加します次にEditorPartCollection コンストラクタ使用して新しEditorPartCollection オブジェクト作成しますまた、コレクション読み取り専用であっても、基になる EditorPart コントロール変更できる方法示します

<script runat="server">

  Protected Sub Button1_Click(ByVal
 sender As Object, _
    ByVal e As EventArgs)
    
    Dim list As New ArrayList(2)
    list.Add(AppearanceEditorPart1)
    list.Add(PropertyGridEditorPart1)
    ' Pass an ICollection object to the constructor.
    Dim myParts As New EditorPartCollection(list)
    Dim editor As EditorPart
    For Each editor In myParts
      editor.BackColor = System.Drawing.Color.LightBlue
      editor.Description = "My " + editor.DisplayTitle
 + " editor."
    Next editor
    
    ' Use the IndexOf property to locate an EditorPart control.
    Dim propertyGridPart As Integer
 = _
      myParts.IndexOf(PropertyGridEditorPart1)
    myParts(propertyGridPart).ChromeType = PartChromeType.TitleOnly
    
    ' Use the Contains method to see if an EditorPart exists.
    If Not myParts.Contains(LayoutEditorPart1)
 Then
      LayoutEditorPart1.BackColor = System.Drawing.Color.LightYellow
    End If
    
    ' Use the CopyTo method to create an array of EditorParts.
    Dim partArray(2) As EditorPart
    partArray(0) = LayoutEditorPart1
    myParts.CopyTo(partArray, 1)
    Label1.Text = "<h3>EditorParts in Custom Array</h3>"
    Dim ePart As EditorPart
    For Each ePart In partArray
      Label1.Text += ePart.Title + "<br />"
    Next ePart

  End Sub

</script>
<script runat="server">

  protected void Button1_Click(object sender,
 EventArgs e)
  {
    ArrayList list = new ArrayList(2);
    list.Add(AppearanceEditorPart1);
    list.Add(PropertyGridEditorPart1);
    // Pass an ICollection object to the constructor.
    EditorPartCollection myParts = new EditorPartCollection(list);
    foreach (EditorPart editor in myParts)
    {
      editor.BackColor = System.Drawing.Color.LightBlue;
      editor.Description = "My " + editor.DisplayTitle + " editor.";
    }

    // Use the IndexOf property to locate an EditorPart control.
    int propertyGridPart = myParts.IndexOf(PropertyGridEditorPart1);
    myParts[propertyGridPart].ChromeType = PartChromeType.TitleOnly;

    // Use the Contains method to see if an EditorPart exists.
    if(!myParts.Contains(LayoutEditorPart1))
      LayoutEditorPart1.BackColor = System.Drawing.Color.LightYellow;
    
    // Use the CopyTo method to create an array of EditorParts.
    EditorPart[] partArray = new EditorPart[3];
    partArray[0] = LayoutEditorPart1;
    myParts.CopyTo(partArray,1);
    Label1.Text = "<h3>EditorParts in Custom Array</h3>";
    foreach (EditorPart ePart in partArray)
    {
      Label1.Text += ePart.Title + "<br />";
    }

  }

</script>

ブラウザページ読み込み、[Display Mode] ドロップダウン リスト コントロールの [編集] を選択することにより、ページ編集モード切り替えることができますTextDisplayWebPart コントロールタイトル バー動詞メニュー (下向き矢印) をクリックし、[編集] をクリックすることにより、コントロール編集できます編集中のユーザー インターフェイス (UI) が表示状態の場合すべての EditorPart コントロール表示できます。[Create EditorPartCollection] ボタンクリックしてEditorPartCollection オブジェクト追加される 2 つEditorPart コントロール対す効果確認します

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
EditorPartCollection クラス
EditorPartCollection メンバ
System.Web.UI.WebControls.WebParts 名前空間
IWebEditable
EditorParts
その他の技術情報
ASP.NET Web パーツ ページ

EditorPartCollection コンストラクタ (EditorPartCollection, ICollection)

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

EditorPart コントロールの EditorPartCollection コレクション、および追加EditorPart コントロールICollection コレクションを渡すことによって、EditorPartCollection クラス新しインスタンス初期化します。

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

Public Sub New ( _
    existingEditorParts As EditorPartCollection, _
    editorParts As ICollection _
)
Dim existingEditorParts As EditorPartCollection
Dim editorParts As ICollection

Dim instance As New EditorPartCollection(existingEditorParts,
 editorParts)
public EditorPartCollection (
    EditorPartCollection existingEditorParts,
    ICollection editorParts
)
public:
EditorPartCollection (
    EditorPartCollection^ existingEditorParts, 
    ICollection^ editorParts
)
public EditorPartCollection (
    EditorPartCollection existingEditorParts, 
    ICollection editorParts
)
public function EditorPartCollection (
    existingEditorParts : EditorPartCollection, 
    editorParts : ICollection
)

パラメータ

existingEditorParts

ゾーン内の既存の EditorPart コントロールの ICollection。

editorParts

ゾーン内にはないがプログラム作成された、EditorPart コントロールICollection

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
EditorPartCollection クラス
EditorPartCollection メンバ
System.Web.UI.WebControls.WebParts 名前空間
その他の技術情報
ASP.NET Web パーツ ページ

EditorPartCollection コンストラクタ

EditorPartCollection クラス新しインスタンス初期化します。 ASP.NET Web パーツ ページ
オーバーロードの一覧オーバーロードの一覧

名前 説明
EditorPartCollection () EditorPartCollection クラス新しい空のインスタンス初期化します。
EditorPartCollection (ICollection) EditorPart コントロールの ICollection コレクションを渡すことによって、EditorPartCollection クラス新しインスタンス初期化します。
EditorPartCollection (EditorPartCollection, ICollection) EditorPart コントロールEditorPartCollection コレクション、および追加EditorPart コントロールICollection コレクションを渡すことによって、EditorPartCollection クラス新しインスタンス初期化します。
参照参照

関連項目

EditorPartCollection クラス
EditorPartCollection メンバ
System.Web.UI.WebControls.WebParts 名前空間

その他の技術情報

ASP.NET Web パーツ ページ
ASP.NET Web パーツ ページ

EditorPartCollection コンストラクタ ()

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

EditorPartCollection クラス新しい空のインスタンス初期化します。

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

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

EditorPartCollection コンストラクタは、EditorPartCollection クラスの空のインスタンス初期化します。コンストラクタのこのオーバーロードは、EditorZone クラスによってその CreateEditorParts メソッド内部使用され、空のコレクション オブジェクト作成します次にゾーンは、子ゾーン テンプレート宣言されすべての EditorPart コントロールインスタンス作成し内部メソッド使用して、それらをコレクション追加します

EditorPartCollection コンストラクタのこのオーバーロードは、EditorPartCollection新しインスタンス作成、およびそれに対すEditorPart コントロール追加には使用できません。代わりにEditorPartCollection コンストラクタの他のオーバーロードいずれか使用する必要があります

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「EditorPartCollection コンストラクタ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS