ComponentDesigner 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
구성 요소의 디자인 모드 동작을 확장합니다.
public ref class ComponentDesigner : IDisposable, System::ComponentModel::Design::IDesigner, System::ComponentModel::Design::IDesignerFilter
public ref class ComponentDesigner : IDisposable, System::ComponentModel::Design::IComponentInitializer, System::ComponentModel::Design::IDesignerFilter, System::ComponentModel::Design::ITreeDesigner
public class ComponentDesigner : IDisposable, System.ComponentModel.Design.IDesigner, System.ComponentModel.Design.IDesignerFilter
public class ComponentDesigner : IDisposable, System.ComponentModel.Design.IComponentInitializer, System.ComponentModel.Design.IDesignerFilter, System.ComponentModel.Design.ITreeDesigner
type ComponentDesigner = class
interface IDesigner
interface IDisposable
interface IDesignerFilter
type ComponentDesigner = class
interface ITreeDesigner
interface IDesigner
interface IDisposable
interface IDesignerFilter
interface IComponentInitializer
Public Class ComponentDesigner
Implements IDesigner, IDesignerFilter, IDisposable
Public Class ComponentDesigner
Implements IComponentInitializer, IDesignerFilter, IDisposable, ITreeDesigner
- 상속
-
ComponentDesigner
- 파생
- 구현
예제
다음 코드 예제에서는 예제 ComponentDesigner 구현 및 디자이너와 연결 된 예제 구성 요소를 제공 합니다. 디자이너는 기본 Initialize 메서드를 호출하는 메서드의 재정의Initialize, 구성 요소를 두 번 클릭할 때 표시되는 MessageBox 메서드의 재정의 DoDefaultAction 및 구성 요소의 바로 가기 메뉴에 사용자 지정 DesignerVerb 메뉴 명령을 제공하는 속성 접근자의 재정의 Verbs 를 구현합니다.
#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 디자인 모드에서 연결된 구성 요소의 동작을 확장할 수 있는 간단한 디자이너를 제공합니다.
ComponentDesigner 는 디자인 타임에 연결된 구성 요소의 특성, 속성 및 이벤트를 조정하기 위해 메서드를 재정의할 수 있는 빈 IDesignerFilter 인터페이스 구현을 제공합니다.
를 사용하여 디자이너를 형식과 연결할 수 있습니다 DesignerAttribute. 디자인 타임 동작 사용자 지정에 대한 개요는 Design-Time 지원 확장을 참조하세요.
이 클래스는 ComponentDesigner 상속된 구성 요소의 속성 설명자에 대한 특수 동작을 구현합니다. 명명된 InheritedPropertyDescriptor 내부 형식은 기본 ComponentDesigner 구현에서 기본 클래스에서 상속된 속성에 대해 대기하는 데 사용됩니다. 이러한 속성 설명자가 추가되는 두 가지 경우가 있습니다.
기본 클래스에서 상속하기 때문에 속성에서 반환 IDesignerHost.RootComponent 되는 루트 개체 자체에 대해
루트 개체의 기본 클래스에 있는 필드입니다. 사용자가 조작할 수 있도록 기본 클래스의 공용 및 보호된 필드가 디자이너에 추가됩니다.
InheritedPropertyDescriptor 개체 인스턴스화 시 기본값이 현재 값이 되도록 클래스는 속성의 기본값을 수정합니다. 속성이 다른 인스턴스에서 상속되기 때문입니다. 디자이너는 속성 값을 상속된 클래스에서 설정한 값으로 설정하는 것으로 다시 설정하는 것을 정의합니다. 이 값은 메타데이터에 저장된 기본값과 다를 수 있습니다.
생성자
| Name | Description |
|---|---|
| ComponentDesigner() |
ComponentDesigner 클래스의 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| ActionLists |
디자이너와 연결된 구성 요소에서 지원하는 디자인 타임 작업 목록을 가져옵니다. |
| AssociatedComponents |
디자이너에서 관리하는 구성 요소와 연결된 구성 요소의 컬렉션을 가져옵니다. |
| Component |
이 디자이너가 디자인하는 구성 요소를 가져옵니다. |
| InheritanceAttribute |
연결된 구성 요소의 상속 유형을 나타내는 특성을 가져옵니다. |
| Inherited |
이 구성 요소가 상속되는지 여부를 나타내는 값을 가져옵니다. |
| ParentComponent |
이 디자이너의 부모 구성 요소를 가져옵니다. |
| SetTextualDefaultProperty |
구성 요소의 디자인 모드 동작을 확장합니다. |
| ShadowProperties |
사용자 설정을 재정의하는 속성 값의 컬렉션을 가져옵니다. |
| Verbs |
디자이너와 연결된 구성 요소에서 지원하는 디자인 타임 동사를 가져옵니다. |
메서드
| Name | Description |
|---|---|
| Dispose() |
에서 사용하는 모든 리소스를 ComponentDesigner해제합니다. |
| Dispose(Boolean) |
관리되지 않는 리소스를 ComponentDesigner 해제하고 관리되는 리소스를 선택적으로 해제합니다. |
| DoDefaultAction() |
구성 요소의 기본 이벤트에 대한 소스 코드 파일에 메서드 서명을 만들고 사용자의 커서를 해당 위치로 이동합니다. |
| Equals(Object) |
지정된 개체가 현재 개체와 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| Finalize() |
가비지 수집에서 개체를 회수하기 전에 호출 |
| GetHashCode() |
기본 해시 함수로 사용됩니다. (다음에서 상속됨 Object) |
| GetService(Type) |
디자이너 구성 요소의 디자인 모드 사이트에서 지정된 서비스 유형을 검색하려고 시도합니다. |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| Initialize(IComponent) |
지정된 구성 요소를 보고 편집하고 디자인할 디자이너를 준비합니다. |
| InitializeExistingComponent(IDictionary) |
기존 구성 요소를 다시 초기화합니다. |
| InitializeNewComponent(IDictionary) |
새로 만든 구성 요소를 초기화합니다. |
| InitializeNonDefault() |
사용되지 않음.
사용되지 않음.
기본값이 아닌 설정으로 이미 초기화된 가져온 구성 요소에 대한 설정을 초기화합니다. |
| InvokeGetInheritanceAttribute(ComponentDesigner) |
지정된 . InheritanceAttribute 의 값을 가져옵니다 ComponentDesigner. |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| OnSetComponentDefaults() |
사용되지 않음.
사용되지 않음.
구성 요소의 기본 속성을 설정합니다. |
| PostFilterAttributes(IDictionary) |
디자이너가 을 통해 TypeDescriptor노출하는 특성 집합에서 항목을 변경하거나 제거할 수 있습니다. |
| PostFilterEvents(IDictionary) |
디자이너가 을 통해 TypeDescriptor노출하는 이벤트 집합에서 항목을 변경하거나 제거할 수 있습니다. |
| PostFilterProperties(IDictionary) |
디자이너를 통해 TypeDescriptor노출 하는 속성 집합에서 항목을 변경 하거나 제거할 수 있습니다. |
| PreFilterAttributes(IDictionary) |
디자이너가 을 통해 TypeDescriptor노출하는 특성 집합에 추가할 수 있습니다. |
| PreFilterEvents(IDictionary) |
디자이너가 을 통해 TypeDescriptor노출하는 이벤트 집합에 추가할 수 있습니다. |
| PreFilterProperties(IDictionary) |
디자이너를 통해 TypeDescriptor노출 하는 속성 집합에 추가할 수 있습니다. |
| RaiseComponentChanged(MemberDescriptor, Object, Object) |
이 구성 요소가 변경되었음을 알 IComponentChangeService 수 있습니다. |
| RaiseComponentChanging(MemberDescriptor) |
이 구성 요소가 변경될 예정임을 알 IComponentChangeService 수 있습니다. |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |
명시적 인터페이스 구현
| Name | Description |
|---|---|
| IDesignerFilter.PostFilterAttributes(IDictionary) |
이 멤버에 대한 설명은 메서드를 참조하세요 PostFilterAttributes(IDictionary) . |
| IDesignerFilter.PostFilterEvents(IDictionary) |
이 멤버에 대한 설명은 메서드를 참조하세요 PostFilterEvents(IDictionary) . |
| IDesignerFilter.PostFilterProperties(IDictionary) |
이 멤버에 대한 설명은 메서드를 참조하세요 PostFilterProperties(IDictionary) . |
| IDesignerFilter.PreFilterAttributes(IDictionary) |
이 멤버에 대한 설명은 메서드를 참조하세요 PreFilterAttributes(IDictionary) . |
| IDesignerFilter.PreFilterEvents(IDictionary) |
이 멤버에 대한 설명은 메서드를 참조하세요 PreFilterEvents(IDictionary) . |
| IDesignerFilter.PreFilterProperties(IDictionary) |
이 멤버에 대한 설명은 메서드를 참조하세요 PreFilterProperties(IDictionary) . |
| ITreeDesigner.Children |
이 멤버에 대한 설명은 속성을 참조하세요 Children . |
| ITreeDesigner.Parent |
이 멤버에 대한 설명은 속성을 참조하세요 Parent . |