ComponentDesigner ComponentDesigner ComponentDesigner ComponentDesigner Class

정의

구성 요소의 디자인 모드 동작을 확장합니다.Extends the design mode behavior of a component.

public ref class ComponentDesigner : IDisposable, System::ComponentModel::Design::IComponentInitializer, System::ComponentModel::Design::IDesignerFilter, System::ComponentModel::Design::ITreeDesigner
public class ComponentDesigner : IDisposable, System.ComponentModel.Design.IComponentInitializer, System.ComponentModel.Design.IDesignerFilter, System.ComponentModel.Design.ITreeDesigner
type ComponentDesigner = class
    interface ITreeDesigner
    interface IDesigner
    interface IDisposable
    interface IDesignerFilter
    interface IComponentInitializer
Public Class ComponentDesigner
Implements IComponentInitializer, IDesignerFilter, IDisposable, ITreeDesigner
상속
ComponentDesignerComponentDesignerComponentDesignerComponentDesigner
파생
구현

예제

다음 코드 예제에서는 ComponentDesigner 구현과 디자이너와 연결 된 예제 구성 요소입니다.The following code example provides an example ComponentDesigner implementation and an example component associated with the designer. 재정의 구현 하는 디자이너는 Initialize 기본을 호출 하는 메서드 Initialize 메서드를 재정의 하는 DoDefaultAction 표시 하는 메서드를 MessageBox 구성 요소를 두 번 재정의 및는 Verbs 사용자 지정을 제공 하는 속성 접근자 DesignerVerb 구성 요소에 대 한 바로 가기 메뉴에 메뉴 명령입니다.The designer implements an override of the Initialize method that calls the base Initialize method, an override of the DoDefaultAction method that displays a MessageBox when the component is double-clicked, and an override of the Verbs property accessor that supplies a custom DesignerVerb menu command to the shortcut menu for the component.

#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(){}
};
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()
        {
        }
    }
}
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

        ' 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

        ' 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

        ' 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
    End Class

    ' 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
    End Class

End Namespace 'ExampleComponent

설명

ComponentDesigner 기본 디자이너 클래스 디자인 모드에서 관련된 된 구성의 동작을 확장할 수 있는 간단한 디자이너를 제공 합니다.The ComponentDesigner base designer class provides a simple designer that can extend the behavior of an associated component in design mode.

ComponentDesigner 빈 제공 IDesignerFilter 인터페이스 구현, 특성, 속성 및 이벤트 관련된 된 구성 요소의 디자인 타임에 맞게 해당 메서드를 재정의할 수 있습니다.ComponentDesigner provides an empty IDesignerFilter interface implementation, whose methods can be overridden to adjust the attributes, properties and events of the associated component at design time.

디자이너를 사용 하 여 형식에 연결할 수 있습니다는 DesignerAttribute합니다.You can associate a designer with a type using a DesignerAttribute. 디자인 타임 동작을 사용자 지정의 개요를 보려면 디자인 타임 지원 확장합니다.For an overview of customizing design-time behavior, see Extending Design-Time Support.

ComponentDesigner 클래스는 상속 된 구성 요소의 속성 설명자에 대 한 특별 한 동작을 구현 합니다.The ComponentDesigner class implements a special behavior for the property descriptors of inherited components. 라는 내부 형식을 InheritedPropertyDescriptor 는 기본적으로 사용 됩니다 ComponentDesigner 기본 클래스에서 상속 된 속성을 구현 합니다.An internal type named InheritedPropertyDescriptor is used by the default ComponentDesigner implementation to stand in for properties that are inherited from a base class. 이러한 속성 설명자 추가 되는 두 가지 경우가 있습니다.There are two cases in which these property descriptors are added.

  1. 반환 된 루트 개체 자체에 IDesignerHost.RootComponent 속성을 해당 기본 클래스에서 상속 하는 합니다.To the root object itself, which is returned by the IDesignerHost.RootComponent property, because you are inheriting from its base class.

  2. 루트 개체의 기본 클래스에 있는 필드에 있습니다.To fields found in the base class of the root object. 기본 클래스에서 public 및 protected 필드는 사용자가 조작할 수 있도록 디자이너에 추가 됩니다.Public and protected fields from the base class are added to the designer so that they can be manipulated by the user.

InheritedPropertyDescriptor 기본 값이 개체를 인스턴스화할 때 현재 값이 되도록 클래스 속성의 기본값을 수정 합니다.The InheritedPropertyDescriptor class modifies the default value of a property, so that the default value is the current value at object instantiation. 즉, 다른 인스턴스로부터 속성 상속 됩니다.This is because the property is inherited from another instance. 디자이너 정의 상속 된 클래스에 의해 설정 된 값으로 설정 된 하는 속성 값 다시 설정 합니다.The designer defines resetting the property value as setting it to the value that was set by the inherited class. 이 값은 메타 데이터에 저장 된 기본 값에서 달라질 수 있습니다.This value may differ from the default value stored in metadata.

생성자

ComponentDesigner() ComponentDesigner() ComponentDesigner() ComponentDesigner()

ComponentDesigner 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ComponentDesigner class.

속성

ActionLists ActionLists ActionLists ActionLists

디자이너와 관련된 구성 요소에서 지원하는 디자인 타임 작업 목록을 가져옵니다.Gets the design-time action lists supported by the component associated with the designer.

AssociatedComponents AssociatedComponents AssociatedComponents AssociatedComponents

디자이너가 관리하는 구성 요소와 관련된 구성 요소 컬렉션을 가져옵니다.Gets the collection of components associated with the component managed by the designer.

Component Component Component Component

이 디자이너에서 디자인하고 있는 구성 요소를 가져옵니다.Gets the component this designer is designing.

InheritanceAttribute InheritanceAttribute InheritanceAttribute InheritanceAttribute

관련된 구성 요소의 상속 형식을 나타내는 특성을 가져옵니다.Gets an attribute that indicates the type of inheritance of the associated component.

Inherited Inherited Inherited Inherited

이 구성 요소가 상속되었는지 여부를 나타내는 값을 가져옵니다.Gets a value indicating whether this component is inherited.

ParentComponent ParentComponent ParentComponent ParentComponent

이 디자이너의 부모 구성 요소를 가져옵니다.Gets the parent component for this designer.

ShadowProperties ShadowProperties ShadowProperties ShadowProperties

사용자 설정을 재정의하는 속성 값의 컬렉션을 가져옵니다.Gets a collection of property values that override user settings.

Verbs Verbs Verbs Verbs

디자이너와 관련된 구성 요소에서 지원하는 디자인 타임 동사를 가져옵니다.Gets the design-time verbs supported by the component that is associated with the designer.

메서드

Dispose() Dispose() Dispose() Dispose()

ComponentDesigner에서 사용하는 모든 리소스를 해제합니다.Releases all resources used by the ComponentDesigner.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

ComponentDesigner에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.Releases the unmanaged resources used by the ComponentDesigner and optionally releases the managed resources.

DoDefaultAction() DoDefaultAction() DoDefaultAction() DoDefaultAction()

구성 요소의 기본 이벤트에 대한 소스 코드 파일에 메서드 시그니처를 만들고 해당 위치로 사용자의 커서를 이동합니다.Creates a method signature in the source code file for the default event on the component and navigates the user's cursor to that location.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object.

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

가비지 수집에서 개체를 회수하기 전에 Dispose(false)를 호출하여 리소스를 해제하려고 합니다.Attempts to free resources by calling Dispose(false) before the object is reclaimed by garbage collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

기본 해시 함수로 작동합니다.Serves as the default hash function.

(Inherited from Object)
GetService(Type) GetService(Type) GetService(Type) GetService(Type)

디자이너 구성 요소의 디자인 모드 사이트에서 지정된 서비스 종류를 검색합니다.Attempts to retrieve the specified type of service from the design mode site of the designer's component.

GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
Initialize(IComponent) Initialize(IComponent) Initialize(IComponent) Initialize(IComponent)

지정된 구성 요소를 표시, 편집 및 디자인할 디자이너를 준비합니다.Prepares the designer to view, edit, and design the specified component.

InitializeExistingComponent(IDictionary) InitializeExistingComponent(IDictionary) InitializeExistingComponent(IDictionary) InitializeExistingComponent(IDictionary)

기존 구성 요소를 다시 초기화합니다.Reinitializes an existing component.

InitializeNewComponent(IDictionary) InitializeNewComponent(IDictionary) InitializeNewComponent(IDictionary) InitializeNewComponent(IDictionary)

새로 만든 구성 요소를 초기화합니다.Initializes a newly created component.

InitializeNonDefault() InitializeNonDefault() InitializeNonDefault() InitializeNonDefault()

기본값이 아닌 설정으로 이미 초기화되어 가져온 구성 요소의 설정을 초기화합니다.Initializes the settings for an imported component that is already initialized to settings other than the defaults.

InvokeGetInheritanceAttribute(ComponentDesigner) InvokeGetInheritanceAttribute(ComponentDesigner) InvokeGetInheritanceAttribute(ComponentDesigner) InvokeGetInheritanceAttribute(ComponentDesigner)

지정된 InheritanceAttributeComponentDesigner를 가져옵니다.Gets the InheritanceAttribute of the specified ComponentDesigner.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
OnSetComponentDefaults() OnSetComponentDefaults() OnSetComponentDefaults() OnSetComponentDefaults()

구성 요소의 기본 속성을 설정합니다.Sets the default properties for the component.

PostFilterAttributes(IDictionary) PostFilterAttributes(IDictionary) PostFilterAttributes(IDictionary) PostFilterAttributes(IDictionary)

디자이너에서 TypeDescriptor를 통해 노출되는 특성 집합의 항목을 변경하거나 제거하도록 합니다.Allows a designer to change or remove items from the set of attributes that it exposes through a TypeDescriptor.

PostFilterEvents(IDictionary) PostFilterEvents(IDictionary) PostFilterEvents(IDictionary) PostFilterEvents(IDictionary)

디자이너에서 TypeDescriptor를 통해 노출되는 이벤트 집합의 항목을 변경하거나 제거하도록 합니다.Allows a designer to change or remove items from the set of events that it exposes through a TypeDescriptor.

PostFilterProperties(IDictionary) PostFilterProperties(IDictionary) PostFilterProperties(IDictionary) PostFilterProperties(IDictionary)

디자이너에서 TypeDescriptor를 통해 노출되는 속성 집합의 항목을 변경하거나 제거하도록 합니다.Allows a designer to change or remove items from the set of properties that it exposes through a TypeDescriptor.

PreFilterAttributes(IDictionary) PreFilterAttributes(IDictionary) PreFilterAttributes(IDictionary) PreFilterAttributes(IDictionary)

디자이너에서 TypeDescriptor를 통해 노출되는 특성 집합에 항목을 추가하도록 합니다.Allows a designer to add to the set of attributes that it exposes through a TypeDescriptor.

PreFilterEvents(IDictionary) PreFilterEvents(IDictionary) PreFilterEvents(IDictionary) PreFilterEvents(IDictionary)

디자이너에서 TypeDescriptor를 통해 노출되는 이벤트 집합에 항목을 추가하도록 합니다.Allows a designer to add to the set of events that it exposes through a TypeDescriptor.

PreFilterProperties(IDictionary) PreFilterProperties(IDictionary) PreFilterProperties(IDictionary) PreFilterProperties(IDictionary)

디자이너에서 TypeDescriptor를 통해 노출되는 속성 집합에 항목을 추가하도록 합니다.Allows a designer to add to the set of properties that it exposes through a TypeDescriptor.

RaiseComponentChanged(MemberDescriptor, Object, Object) RaiseComponentChanged(MemberDescriptor, Object, Object) RaiseComponentChanged(MemberDescriptor, Object, Object) RaiseComponentChanged(MemberDescriptor, Object, Object)

IComponentChangeService에 이 구성 요소가 변경되었음을 알립니다.Notifies the IComponentChangeService that this component has been changed.

RaiseComponentChanging(MemberDescriptor) RaiseComponentChanging(MemberDescriptor) RaiseComponentChanging(MemberDescriptor) RaiseComponentChanging(MemberDescriptor)

IComponentChangeService에 이 구성 요소가 변경될 예정임을 알립니다.Notifies the IComponentChangeService that this component is about to be changed.

ToString() ToString() ToString() ToString()

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(Inherited from Object)

명시적 인터페이스 구현

IDesignerFilter.PostFilterAttributes(IDictionary) IDesignerFilter.PostFilterAttributes(IDictionary) IDesignerFilter.PostFilterAttributes(IDictionary) IDesignerFilter.PostFilterAttributes(IDictionary)

이 멤버에 대한 설명을 보려면 PostFilterAttributes(IDictionary) 메서드를 참조하세요.For a description of this member, see the PostFilterAttributes(IDictionary) method.

IDesignerFilter.PostFilterEvents(IDictionary) IDesignerFilter.PostFilterEvents(IDictionary) IDesignerFilter.PostFilterEvents(IDictionary) IDesignerFilter.PostFilterEvents(IDictionary)

이 멤버에 대한 설명을 보려면 PostFilterEvents(IDictionary) 메서드를 참조하세요.For a description of this member, see the PostFilterEvents(IDictionary) method.

IDesignerFilter.PostFilterProperties(IDictionary) IDesignerFilter.PostFilterProperties(IDictionary) IDesignerFilter.PostFilterProperties(IDictionary) IDesignerFilter.PostFilterProperties(IDictionary)

이 멤버에 대한 설명을 보려면 PostFilterProperties(IDictionary) 메서드를 참조하세요.For a description of this member, see the PostFilterProperties(IDictionary) method.

IDesignerFilter.PreFilterAttributes(IDictionary) IDesignerFilter.PreFilterAttributes(IDictionary) IDesignerFilter.PreFilterAttributes(IDictionary) IDesignerFilter.PreFilterAttributes(IDictionary)

이 멤버에 대한 설명을 보려면 PreFilterAttributes(IDictionary) 메서드를 참조하세요.For a description of this member, see the PreFilterAttributes(IDictionary) method.

IDesignerFilter.PreFilterEvents(IDictionary) IDesignerFilter.PreFilterEvents(IDictionary) IDesignerFilter.PreFilterEvents(IDictionary) IDesignerFilter.PreFilterEvents(IDictionary)

이 멤버에 대한 설명을 보려면 PreFilterEvents(IDictionary) 메서드를 참조하세요.For a description of this member, see the PreFilterEvents(IDictionary) method.

IDesignerFilter.PreFilterProperties(IDictionary) IDesignerFilter.PreFilterProperties(IDictionary) IDesignerFilter.PreFilterProperties(IDictionary) IDesignerFilter.PreFilterProperties(IDictionary)

이 멤버에 대한 설명을 보려면 PreFilterProperties(IDictionary) 메서드를 참조하세요.For a description of this member, see the PreFilterProperties(IDictionary) method.

ITreeDesigner.Children ITreeDesigner.Children ITreeDesigner.Children ITreeDesigner.Children

이 멤버에 대한 설명을 보려면 Children 속성을 참조하세요.For a description of this member, see the Children property.

ITreeDesigner.Parent ITreeDesigner.Parent ITreeDesigner.Parent ITreeDesigner.Parent

이 멤버에 대한 설명을 보려면 Parent 속성을 참조하세요.For a description of this member, see the Parent property.

적용 대상

추가 정보