ContainerControlDesigner クラス

定義

デザイン時に変更できる子コントロールまたはプロパティを含むコントロールのデザイナー機能を提供します。

public ref class ContainerControlDesigner : System::Web::UI::Design::ControlDesigner
public class ContainerControlDesigner : System.Web.UI.Design.ControlDesigner
type ContainerControlDesigner = class
    inherit ControlDesigner
Public Class ContainerControlDesigner
Inherits ControlDesigner
継承
派生

次のコード例は、 ContainerControlDesigner クラスからデザイナー クラスを派生させる方法を示しています。 この例では、 CompositeControl クラスから派生した単純なコントロールを定義し、関連付けられたデザイナーを定義します。このデザイナーは、 ContainerControlDesigner クラスから派生します。 派生デザイナー クラスは、 FrameCaption プロパティと FrameStyle プロパティをオーバーライドして、デザイン サーフェイス上のコントロールの編集可能な領域を囲むフレームをカスタマイズします。

using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.Design;
using System.Web.UI.Design.WebControls;
using System.Web.UI.WebControls;

namespace ControlDesignerSamples.CS
{

    // Define a simple composite control, derived from the 
    // System.Web.UI.WebControls.CompositeControl class.
    [
        Designer(typeof(SimpleContainerControlDesigner)) , 
        ParseChildren(false)
    ]
    public class SimpleContainerControl : CompositeControl
    {
    }


    // Define the designer for the simple composite control.
    // The designer derives from System.Web.UI.Design.ContainerControlDesigner.
    // The designer defines the style and caption for frame around the 
    // editable region in the design surface.
    public class SimpleContainerControlDesigner : ContainerControlDesigner
    {
        private Style _style = null;

        // Define the caption text for the frame in the design surface.
        public override string FrameCaption
        {
            get
            {
                return "= My simple container control =";
            }
        }

        // Define the style of the frame around the control in the design surface.
        public override Style FrameStyle
        {
            get
            {
                if (_style == null)
                {
                    _style = new Style();
                    _style.Font.Name = "Verdana";
                    _style.Font.Size = new FontUnit("XSmall");
                    _style.BackColor = Color.LavenderBlush;
                    _style.ForeColor = Color.DarkBlue;
                }

                return _style;
            }
        }
    }
}

Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Collections
Imports System.Drawing
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.Design.WebControls
Imports System.Web.UI.WebControls

Namespace ControlDesignerSamples.VB


    ' Define a simple composite control, derived from the 
    ' System.Web.UI.WebControls.CompositeControl class.

    <Designer(GetType(SimpleContainerControlDesigner)), _
     ParseChildren(False)> _
    Public Class SimpleContainerControl
        Inherits CompositeControl

    End Class


    ' Define the designer for the simple composite control.
    ' The designer derives from System.Web.UI.Design.ContainerControlDesigner.
    ' The designer defines the style and caption for the frame around the 
    ' editable region of the control in the design surface.
    Public Class SimpleContainerControlDesigner
        Inherits ContainerControlDesigner

        Private _style As Style = Nothing

        ' Define the caption text for the frame in the design surface.
        Public Overrides ReadOnly Property FrameCaption() As String
            Get
                Return "- My simple container control -"
            End Get
        End Property


        ' Define the style of the frame around the control in the design surface.
        Public Overrides ReadOnly Property FrameStyle() As Style
            Get
                If _style Is Nothing Then

                    _style = New Style()
                    _style.Font.Name = "Verdana"
                    _style.Font.Size = New FontUnit("XSmall")
                    _style.BackColor = Color.LavenderBlush
                    _style.ForeColor = Color.DarkBlue
                End If

                Return _style
            End Get
        End Property


    End Class

End Namespace

注釈

ContainerControlDesigner クラスは、デザイン サーフェイスで変更できるコントロールの基本デザイナー クラスを提供します。 これには、子コントロールまたは編集可能な内部プロパティを含むコントロールが含まれます。 ContainerControlDesignerは、コントロールを表す単一のフレーム領域を提供し、デザイン時にコントロールのレンダリングを自動的に処理します。

関連付けられたコントロールに ParseChildrenAttribute 属性を適用して、 ContainerControlDesignerのデザイン時の動作を決定します。 関連付けられているコントロールに ParseChildrenAttribute 設定を次のように適用します。

  • false は、 ContainerControlDesigner が編集可能なデザイン領域の内容を子コントロールとして表していることを示します。

  • true ContainerControlDesignerが編集可能なデザイン領域の内容をコントロールの編集可能な内部プロパティとして表していることを示します。

コントロール開発者は、次の一覧で定義されているように、開発されるコントロールの種類に応じて、いくつかの基本デザイナーの 1 つからカスタム デザイナーを派生および拡張できます。

  • デザイン時に子コントロールを追加できるようにするコントロールは、 ContainerControlDesigner クラスから派生できます。 たとえば、 PanelContainerDesigner クラスは ContainerControlDesigner クラスから派生し、デザイン サーフェイスの Panel コントロールを表します。

  • 1 つ以上の子コントロールを持ち、デザイン時にコントロールを追加できる編集可能なデザイナー領域を持つコントロールは、 CompositeControlDesigner クラスから派生できます。

  • カスタムのデザイン時処理を必要とするコントロールは、基本 ControlDesigner クラスから派生できます。

Note

ContainerControlDesignerクラスは、古いReadWriteControlDesignerクラスを置き換えます。

DesignerAttribute属性を使用して、カスタム デザイナー クラスをカスタム コントロールの実装と関連付けます。 カスタム コントロールでコントロール デザイナーを使用する方法の詳細については、「 チュートリアル: Web サーバー コントロールの基本的なコントロール デザイナーを作成する」を参照してください。

コンストラクター

名前 説明
ContainerControlDesigner()

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

プロパティ

名前 説明
ActionLists

コントロール デザイナーのアクション リスト コレクションを取得します。

(継承元 ControlDesigner)
AllowResize

デザイン時にコントロールのサイズを変更できるかどうかを示す値を取得します。

AssociatedComponents

デザイナーによって管理されるコンポーネントに関連付けられているコンポーネントのコレクションを取得します。

(継承元 ComponentDesigner)
AutoFormats

デザイン時に関連付けられているコントロールの [自動書式] ダイアログ ボックスに表示する、定義済みの 自動書式設定 スキームのコレクションを取得します。

(継承元 ControlDesigner)
Behavior
古い.

デザイナーに関連付けられている DHTML 動作を取得または設定します。

(継承元 HtmlControlDesigner)
Component

デザイナーが設計しているコンポーネントを取得します。

(継承元 ComponentDesigner)
DataBindings

現在のコントロールのデータ バインディング コレクションを取得します。

(継承元 HtmlControlDesigner)
DataBindingsEnabled

関連付けられたコントロールの包含領域でデータ バインディングがサポートされているかどうかを示す値を取得します。

(継承元 ControlDesigner)
DesignerState

デザイン時に関連付けられたコントロールのデータを保持するために使用されるオブジェクトを取得します。

(継承元 ControlDesigner)
DesignTimeElement
古い.

デザイン サーフェイス上の HtmlControlDesigner オブジェクトに関連付けられているコントロールを表すデザイン時オブジェクトを取得します。

(継承元 HtmlControlDesigner)
DesignTimeElementView
古い.

コントロール デザイナーのビュー コントロール オブジェクトを取得します。

(継承元 ControlDesigner)
DesignTimeHtmlRequiresLoadComplete
古い.

GetDesignTimeHtml メソッドを呼び出す前に、デザイン ホストが読み込みを完了する必要があるかどうかを示す値を取得します。

(継承元 ControlDesigner)
Expressions

デザイン時の現在のコントロールの式バインドを取得します。

(継承元 HtmlControlDesigner)
FrameCaption

デザイン時にコントロールに表示されるキャプションを取得します。

FrameStyle

デザイン時にコントロール フレームに適用されるスタイルを取得します。

HidePropertiesInTemplateMode

コントロールがテンプレート モードのときに、関連付けられているコントロールのプロパティが非表示かどうかを示す値を取得します。

(継承元 ControlDesigner)
ID

コントロールの ID 文字列を取得または設定します。

(継承元 ControlDesigner)
InheritanceAttribute

関連付けられているコンポーネントの継承の種類を示す属性を取得します。

(継承元 ComponentDesigner)
Inherited

このコンポーネントが継承されるかどうかを示す値を取得します。

(継承元 ComponentDesigner)
InTemplateMode

コントロールがデザイン ホストのテンプレート表示モードまたは編集モードであるかどうかを示す値を取得します。 InTemplateMode プロパティは読み取り専用です。

(継承元 ControlDesigner)
IsDirty
古い.

Web サーバー コントロールが変更済みとしてマークされているかどうかを示す値を取得または設定します。

(継承元 ControlDesigner)
NoWrap

テーブルで HTML nowrap 属性を使用するかどうかを指定する値を取得します。

ParentComponent

このデザイナーの親コンポーネントを取得します。

(継承元 ComponentDesigner)
ReadOnly
古い.

コントロールのプロパティがデザイン時に読み取り専用かどうかを示す値を取得または設定します。

(継承元 ControlDesigner)
RootDesigner

関連付けられたコントロールを含む Web フォーム ページのコントロール デザイナーを取得します。

(継承元 ControlDesigner)
ShadowProperties

ユーザー設定をオーバーライドするプロパティ値のコレクションを取得します。

(継承元 ComponentDesigner)
ShouldCodeSerialize
古い.

シリアル化中に、現在のデザイン ドキュメントの分離コード ファイルでコントロールのフィールド宣言を作成するかどうかを示す値を取得または設定します。

(継承元 HtmlControlDesigner)
Tag

関連付けられたコントロールの HTML マークアップ要素を表すオブジェクトを取得します。

(継承元 ControlDesigner)
TemplateGroups

1 つ以上のテンプレート定義を含むテンプレート グループのコレクションを取得します。

(継承元 ControlDesigner)
UsePreviewControl

コントロール デザイナーが一時的なプレビュー コントロールを使用してデザイン時 HTML マークアップを生成するかどうかを示す値を取得します。

(継承元 ControlDesigner)
Verbs

デザイナーに関連付けられているコンポーネントでサポートされているデザイン時動詞を取得します。

(継承元 ComponentDesigner)
ViewControl

デザイン時の HTML マークアップのプレビューに使用できる Web サーバー コントロールを取得または設定します。

(継承元 ControlDesigner)
ViewControlCreated

デザイン サーフェイスに表示する View コントロールが作成されているかどうかを示す値を取得または設定します。

(継承元 ControlDesigner)
Visible

コントロールがデザイン時に表示されるかどうかを示す値を取得します。

(継承元 ControlDesigner)

メソッド

名前 説明
AddDesignTimeCssAttributes(IDictionary)

デザイン時にコントロールのスタイル属性を追加します。

CreateErrorDesignTimeHtml(String, Exception)

デザイン時に指定した例外エラー メッセージを表示する HTML マークアップを作成します。

(継承元 ControlDesigner)
CreateErrorDesignTimeHtml(String)

デザイン時に指定されたエラー メッセージを表示する HTML マークアップを作成します。

(継承元 ControlDesigner)
CreatePlaceHolderDesignTimeHtml()

コントロールの型と ID を表示する単純な四角形のプレースホルダー表現を提供します。

(継承元 ControlDesigner)
CreatePlaceHolderDesignTimeHtml(String)

コントロールの型と ID、および追加の指定された命令または情報を表示する単純な四角形のプレースホルダー表現を提供します。

(継承元 ControlDesigner)
CreateViewControl()

デザイン サーフェイスで表示またはレンダリングするために、関連付けられているコントロールのコピーを返します。

(継承元 ControlDesigner)
Dispose()

ComponentDesignerで使用されているすべてのリソースを解放します。

(継承元 ComponentDesigner)
Dispose(Boolean)

HtmlControlDesigner オブジェクトによって使用されるアンマネージ リソースを解放し、必要に応じてマネージド リソースを解放します。

(継承元 HtmlControlDesigner)
DoDefaultAction()

コンポーネントの既定のイベントのソース コード ファイルにメソッド シグネチャを作成し、ユーザーのカーソルをその場所に移動します。

(継承元 ComponentDesigner)
Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetBounds()

デザイン サーフェイスに表示されるコントロールの境界を表す四角形の座標を取得します。

(継承元 ControlDesigner)
GetDesignTimeCssAttributes()

デザイン時にコントロールのスタイル属性のコレクションを返します。

GetDesignTimeHtml()

デザイン時にコントロールを表すために使用される HTML マークアップを取得します。

(継承元 ControlDesigner)
GetDesignTimeHtml(DesignerRegionCollection)

デザイン時にコントロールを表すために使用される HTML マークアップを返します。

GetEditableDesignerRegionContent(EditableDesignerRegion)

デザイン時にコントロールの編集可能領域のコンテンツを返します。

GetEmptyDesignTimeHtml()

実行時に視覚的な表現を持たない Web サーバー コントロールをデザイン時に表す HTML マークアップを取得します。

(継承元 ControlDesigner)
GetErrorDesignTimeHtml(Exception)

指定した例外に関する情報を提供する HTML マークアップを取得します。

(継承元 ControlDesigner)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetPersistenceContent()

デザイン時にコントロールの永続化可能なコンテンツを返します。

GetPersistInnerHtml()
古い.

コントロールの永続化可能な内部 HTML マークアップを取得します。

(継承元 ControlDesigner)
GetService(Type)

デザイナーのコンポーネントのデザイン モード サイトから、指定した種類のサービスの取得を試みます。

(継承元 ComponentDesigner)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
GetViewRendering()

関連付けられたコントロールのコンテンツと領域のデザイン時マークアップを含むオブジェクトを取得します。

(継承元 ControlDesigner)
Initialize(IComponent)

コントロール デザイナーを初期化し、指定したコンポーネントを読み込みます。

(継承元 ControlDesigner)
InitializeExistingComponent(IDictionary)

既存のコンポーネントを再初期化します。

(継承元 ComponentDesigner)
InitializeNewComponent(IDictionary)

新しく作成されたコンポーネントを初期化します。

(継承元 ComponentDesigner)
InitializeNonDefault()
古い.
古い.

既定以外の設定に既に初期化されているインポートされたコンポーネントの設定を初期化します。

(継承元 ComponentDesigner)
Invalidate()

デザイン画面に表示されるコントロールの領域全体を無効にし、コントロール デザイナーにコントロールの再描画を通知します。

(継承元 ControlDesigner)
Invalidate(Rectangle)

デザイン画面に表示されるコントロールの指定された領域を無効にし、コントロール デザイナーにコントロールの再描画を通知します。

(継承元 ControlDesigner)
InvokeGetInheritanceAttribute(ComponentDesigner)

指定したInheritanceAttributeComponentDesignerを取得します。

(継承元 ComponentDesigner)
IsPropertyBound(String)
古い.

関連付けられているコントロールの指定したプロパティがデータ バインドされているかどうかを示す値を取得します。

(継承元 ControlDesigner)
Localize(IDesignTimeResourceWriter)

指定されたリソース ライターを使用して、関連付けられているコントロールのローカライズ可能なプロパティをデザイン ホスト内のリソースに保持します。

(継承元 ControlDesigner)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
OnAutoFormatApplied(DesignerAutoFormat)

定義済みの自動書式設定スキームが関連付けられているコントロールに適用されたときに呼び出されます。

(継承元 ControlDesigner)
OnBehaviorDetaching()
古い.

動作が要素から関連付けを解除したときに呼び出されます。

(継承元 HtmlControlDesigner)
OnBindingsCollectionChanged(String)
古い.

データ バインディング コレクションが変更されたときに呼び出されます。

(継承元 ControlDesigner)
OnClick(DesignerRegionMouseEventArgs)

ユーザーがデザイン時に関連付けられているコントロールをクリックすると、デザイン ホストによって呼び出されます。

(継承元 ControlDesigner)
OnComponentChanged(Object, ComponentChangedEventArgs)

関連付けられたコントロールが変更されたときに呼び出されます。

(継承元 ControlDesigner)
OnComponentChanging(Object, ComponentChangingEventArgs)

関連付けられたコントロールの ComponentChanging イベントを処理するメソッドを表します。

(継承元 ControlDesigner)
OnControlResize()
古い.

デザイン時に、関連付けられている Web サーバー コントロールのサイズがデザイン ホストで変更されたときに呼び出されます。

(継承元 ControlDesigner)
OnPaint(PaintEventArgs)

CustomPaint値がtrueされている場合、コントロール デザイナーが関連付けられたコントロールをデザイン サーフェイスに描画するときに呼び出されます。

(継承元 ControlDesigner)
OnSetComponentDefaults()
古い.
古い.

コンポーネントの既定のプロパティを設定します。

(継承元 ComponentDesigner)
OnSetParent()

関連付けられたコントロールが親コントロールにアタッチされている場合に、追加の処理を実行する方法を提供します。

(継承元 HtmlControlDesigner)
PostFilterAttributes(IDictionary)

デザイナーが、 TypeDescriptorを介して公開する一連の属性の項目を変更または削除できるようにします。

(継承元 ComponentDesigner)
PostFilterEvents(IDictionary)

デザイナーが、 TypeDescriptorを介して公開する一連のイベントの項目を変更または削除できるようにします。

(継承元 ComponentDesigner)
PostFilterProperties(IDictionary)

デザイナーが、 TypeDescriptorを介して公開する一連のプロパティから項目を変更または削除できるようにします。

(継承元 ComponentDesigner)
PreFilterAttributes(IDictionary)

デザイナーが、 TypeDescriptorを介して公開する属性のセットに追加できるようにします。

(継承元 ComponentDesigner)
PreFilterEvents(IDictionary)

コンポーネントの TypeDescriptor オブジェクトのデザイン時に公開されるイベントの一覧を設定します。

(継承元 HtmlControlDesigner)
PreFilterProperties(IDictionary)

デザイン 時にデザイン ホストの [プロパティ] グリッドにプロパティを追加または削除するか、関連付けられているコントロールのプロパティに対応する新しいデザイン時プロパティを提供します。

(継承元 ControlDesigner)
RaiseComponentChanged(MemberDescriptor, Object, Object)

このコンポーネントが変更されたことを IComponentChangeService に通知します。

(継承元 ComponentDesigner)
RaiseComponentChanging(MemberDescriptor)

このコンポーネントが変更されようとしていることを IComponentChangeService に通知します。

(継承元 ComponentDesigner)
RaiseResizeEvent()
古い.

OnControlResize() イベントを発生させます。

(継承元 ControlDesigner)
RegisterClone(Object, Object)

複製されたコントロールに内部データを登録します。

(継承元 ControlDesigner)
SetEditableDesignerRegionContent(EditableDesignerRegion, String)

デザイン時にコントロールの編集可能領域のコンテンツを設定します。

SetRegionContent(EditableDesignerRegion, String)

コントロールのデザイン時ビューで編集可能な領域のコンテンツを指定します。

(継承元 ControlDesigner)
SetViewFlags(ViewFlags, Boolean)

指定したフラグ値に、指定したビットごとの ViewFlags 列挙体を割り当てます。

(継承元 ControlDesigner)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
UpdateDesignTimeHtml()

GetDesignTimeHtml メソッドを呼び出して、関連付けられている Web サーバー コントロールのデザイン時 HTML マークアップを更新します。

(継承元 ControlDesigner)

明示的なインターフェイスの実装

名前 説明
IDesignerFilter.PostFilterAttributes(IDictionary)

このメンバーの説明については、 PostFilterAttributes(IDictionary) メソッドを参照してください。

(継承元 ComponentDesigner)
IDesignerFilter.PostFilterEvents(IDictionary)

このメンバーの説明については、 PostFilterEvents(IDictionary) メソッドを参照してください。

(継承元 ComponentDesigner)
IDesignerFilter.PostFilterProperties(IDictionary)

このメンバーの説明については、 PostFilterProperties(IDictionary) メソッドを参照してください。

(継承元 ComponentDesigner)
IDesignerFilter.PreFilterAttributes(IDictionary)

このメンバーの説明については、 PreFilterAttributes(IDictionary) メソッドを参照してください。

(継承元 ComponentDesigner)
IDesignerFilter.PreFilterEvents(IDictionary)

このメンバーの説明については、 PreFilterEvents(IDictionary) メソッドを参照してください。

(継承元 ComponentDesigner)
IDesignerFilter.PreFilterProperties(IDictionary)

このメンバーの説明については、 PreFilterProperties(IDictionary) メソッドを参照してください。

(継承元 ComponentDesigner)
ITreeDesigner.Children

このメンバーの説明については、 Children プロパティを参照してください。

(継承元 ComponentDesigner)
ITreeDesigner.Parent

このメンバーの説明については、 Parent プロパティを参照してください。

(継承元 ComponentDesigner)

適用対象

こちらもご覧ください