ComponentDesigner クラス
アセンブリ: System.Design (system.design.dll 内)

Public Class ComponentDesigner Implements ITreeDesigner, IDesigner, IDisposable, IDesignerFilter, _ IComponentInitializer
public class ComponentDesigner : ITreeDesigner, IDesigner, IDisposable, IDesignerFilter, IComponentInitializer
public ref class ComponentDesigner : ITreeDesigner, IDesigner, IDisposable, IDesignerFilter, IComponentInitializer
public class ComponentDesigner implements ITreeDesigner, IDesigner, IDisposable, IDesignerFilter, IComponentInitializer
public class ComponentDesigner implements ITreeDesigner, IDesigner, IDisposable, IDesignerFilter, IComponentInitializer

ComponentDesigner ベースの デザイナ クラスは、デザイン モードの関連付けられているコンポーネントの動作を拡張できる簡単なデザイナを提供します。
ComponentDesigner は、空の IDesignerFilter インターフェイス実装を提供します。このクラスのメソッドは、デザイン時に関連付けられているコンポーネントの属性、プロパティ、およびイベントを調整するようにオーバーライドできます。
DesignerAttribute を使用してデザイナに型を関連付けることができます。デザイン時の動作のカスタマイズの概要については、「デザイン時サポートの拡張」を参照してください。

ComponentDesigner 実装の例とデザイナに関連付けられているコンポーネントの例を次のコード例に示します。このデザイナは、基本クラスの Initialize メソッドを呼び出す Initialize メソッドのオーバーライド、コンポーネントがダブルクリックされたときに MessageBox を表示する DoDefaultAction メソッドのオーバーライド、およびコンポーネントのショートカット メニューへのカスタム DesignerVerb メニュー コマンドを提供する Verbs プロパティ アクセサのオーバーライドを実装します。
Imports System Imports System.Collections Imports System.ComponentModel Imports System.ComponentModel.Design Imports System.Drawing Imports System.Windows.Forms Namespace ExampleComponent ' Provides an example component designer. Public Class ExampleComponentDesigner Inherits System.ComponentModel.Design.ComponentDesigner Public Sub New() End Sub 'New ' This method provides an opportunity to perform processing when a designer is initialized. ' The component parameter is the component that the designer is associated with. Public Overrides Sub Initialize(ByVal component As System.ComponentModel.IComponent) ' Always call the base Initialize method in an override of this method. MyBase.Initialize(component) End Sub 'Initialize ' This method is invoked when the associated component is double-clicked. Public Overrides Sub DoDefaultAction() MessageBox.Show("The event handler for the default action was invoked.") End Sub 'DoDefaultAction ' This method provides designer verbs. Public Overrides ReadOnly Property Verbs() As System.ComponentModel.Design.DesignerVerbCollection Get Return New DesignerVerbCollection(New DesignerVerb() {New DesignerVerb("Example Designer Verb Command", New EventHandler(AddressOf Me.onVerb))}) End Get End Property ' Event handling method for the example designer verb Private Sub onVerb(ByVal sender As Object, ByVal e As EventArgs) MessageBox.Show("The event handler for the Example Designer Verb Command was invoked.") End Sub 'onVerb End Class 'ExampleComponentDesigner ' Provides an example component associated with the example component designer. <DesignerAttribute(GetType(ExampleComponentDesigner), GetType(IDesigner))> _ Public Class ExampleComponent Inherits System.ComponentModel.Component Public Sub New() End Sub 'New End Class 'ExampleComponent End Namespace 'ExampleComponent
using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Drawing; using System.Windows.Forms; namespace ExampleComponent { // Provides an example component designer. public class ExampleComponentDesigner : System.ComponentModel.Design.ComponentDesigner { public ExampleComponentDesigner() { } // This method provides an opportunity to perform processing when a designer is initialized. // The component parameter is the component that the designer is associated with. public override void Initialize(System.ComponentModel.IComponent component) { // Always call the base Initialize method in an override of this method. base.Initialize(component); } // This method is invoked when the associated component is double-clicked. public override void DoDefaultAction() { MessageBox.Show("The event handler for the default action was invoked."); } // This method provides designer verbs. public override System.ComponentModel.Design.DesignerVerbCollection Verbs { get { return new DesignerVerbCollection( new DesignerVerb[] { new DesignerVerb("Example Designer Verb Command", new EventHandler(this.onVerb)) } ); } } // Event handling method for the example designer verb private void onVerb(object sender, EventArgs e) { MessageBox.Show("The event handler for the Example Designer Verb Command was invoked."); } } // Provides an example component associated with the example component designer. [DesignerAttribute(typeof(ExampleComponentDesigner), typeof(IDesigner))] public class ExampleComponent : System.ComponentModel.Component { public ExampleComponent() { } } }
#using <System.dll> #using <System.Design.dll> #using <System.Drawing.dll> #using <System.Windows.Forms.dll> using namespace System; using namespace System::Collections; using namespace System::ComponentModel; using namespace System::ComponentModel::Design; using namespace System::Drawing; using namespace System::Windows::Forms; // Provides an example component designer. ref class ExampleComponentDesigner: public ComponentDesigner { public: ExampleComponentDesigner() { } // This method provides an opportunity to perform processing when a designer is initialized. // The component parameter is the component that the designer is associated with. virtual void Initialize( IComponent^ component ) override { // Always call the base Initialize method in an of this method. ComponentDesigner::Initialize( component ); } // This method is invoked when the associated component is double-clicked. virtual void DoDefaultAction() override { MessageBox::Show( "The event handler for the default action was invoked." ); } // This method provides designer verbs. property DesignerVerbCollection^ Verbs { virtual DesignerVerbCollection^ get() override { array<DesignerVerb^>^ newDesignerVerbs = {gcnew DesignerVerb( "Example Designer Verb Command", gcnew EventHandler( this, &ExampleComponentDesigner::onVerb ) )}; return gcnew DesignerVerbCollection( newDesignerVerbs ); } } private: // Event handling method for the example designer verb void onVerb( Object^ sender, EventArgs^ e ) { MessageBox::Show( "The event handler for the Example Designer Verb Command was invoked." ); } }; // Provides an example component associated with the example component designer. [DesignerAttribute(ExampleComponentDesigner::typeid, IDesigner::typeid)] ref class ExampleComponent: public Component { public: ExampleComponent(){} };
package ExampleComponent; import System.*; import System.Collections.*; import System.ComponentModel.*; import System.ComponentModel.Design.*; import System.Drawing.*; import System.Windows.Forms.*; // Provides an example component designer. public class ExampleComponentDesigner extends System.ComponentModel.Design.ComponentDesigner { public ExampleComponentDesigner() { } //ExampleComponentDesigner // This method provides an opportunity to perform processing when a // designer is initialized.The component parameter is the component that // the designer is associated with. public void Initialize(System.ComponentModel.IComponent component) { // Always call the base Initialize method in an override of this method. super.Initialize(component); } //Initialize // This method is invoked when the associated component is double-clicked. public void DoDefaultAction() { MessageBox.Show("The event handler for the default action was invoked."); } //DoDefaultAction // This method provides designer verbs. /** @property */ public System.ComponentModel.Design.DesignerVerbCollection get_Verbs() { return new DesignerVerbCollection(new DesignerVerb[] { new DesignerVerb("Example Designer Verb Command" , new EventHandler(this.OnVerb)) }); } //get_Verbs // Event handling method for the example designer verb private void OnVerb(Object sender, EventArgs e) { MessageBox.Show("The event handler for the Example Designer Verb" + " Command was invoked."); } //OnVerb } //ExampleComponentDesigner // Provides an example component associated with the example component designer. /** @attribute DesignerAttribute(ExampleComponentDesigner.class, IDesigner.class) */ public class ExampleComponent extends System.ComponentModel.Component { public ExampleComponent() { } //ExampleComponent } //ExampleComponent



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


Weblioに収録されているすべての辞書からComponentDesigner クラスを検索する場合は、下記のリンクをクリックしてください。

- ComponentDesigner クラスのページへのリンク