DesignerAttribute 클래스

정의

구성 요소에 대한 디자인 타임 서비스를 구현하는 데 사용되는 클래스를 지정합니다.

public ref class DesignerAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple=true, Inherited=true)]
public sealed class DesignerAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple=true, Inherited=true)>]
type DesignerAttribute = class
    inherit Attribute
Public NotInheritable Class DesignerAttribute
Inherits Attribute
상속
DesignerAttribute
특성

예제

다음 예제에서는 라는 MyForm클래스를 만듭니다. MyForm에는 이 클래스를 DesignerAttribute 지정하는 와 범주를 DocumentDesigner지정 Form 하는 가 DesignerCategoryAttribute 있는 두 가지 특성이 있습니다.

[Designer("System.Windows.Forms.Design.DocumentDesigner, System.Windows.Forms.Design.DLL",
IRootDesigner::typeid),
DesignerCategory("Form")]
ref class MyForm: public ContainerControl{
   // Insert code here.
};
[Designer("System.Windows.Forms.Design.DocumentDesigner, System.Windows.Forms.Design.DLL", 
    typeof(IRootDesigner)),
    DesignerCategory("Form")]
public class MyForm : ContainerControl {
    // Insert code here.
}
<Designer("System.Windows.Forms.Design.DocumentDesigner, System.Windows.Forms.Design.DLL", _
    GetType(IRootDesigner)), DesignerCategory("Form")> _
Public Class MyForm
    
    Inherits ContainerControl
    ' Insert code here.
End Class

다음 예제에서는 의 instance MyForm만듭니다. 그런 다음 클래스의 특성을 가져오고, 를 추출 DesignerAttribute하고, 디자이너의 이름을 출력합니다.

int main()
{
   // Creates a new form.
   MyForm^ myNewForm = gcnew MyForm;

   // Gets the attributes for the collection.
   AttributeCollection^ attributes = TypeDescriptor::GetAttributes( myNewForm );

   /* Prints the name of the designer by retrieving the DesignerAttribute
       * from the AttributeCollection. */
   DesignerAttribute^ myAttribute = dynamic_cast<DesignerAttribute^>(attributes[ DesignerAttribute::typeid ]);
   Console::WriteLine( "The designer for this class is: {0}", myAttribute->DesignerTypeName );
   return 0;
}
public static int Main() {
    // Creates a new form.
    MyForm myNewForm = new MyForm();
 
    // Gets the attributes for the collection.
    AttributeCollection attributes = TypeDescriptor.GetAttributes(myNewForm);
 
    /* Prints the name of the designer by retrieving the DesignerAttribute
     * from the AttributeCollection. */
    DesignerAttribute myAttribute = 
       (DesignerAttribute)attributes[typeof(DesignerAttribute)];
    Console.WriteLine("The designer for this class is: " + myAttribute.DesignerTypeName);
  
    return 0;
}
Public Shared Function Main() As Integer
    ' Creates a new form.
    Dim myNewForm As New MyForm()
    
    ' Gets the attributes for the collection.
    Dim attributes As AttributeCollection = TypeDescriptor.GetAttributes(myNewForm)
    
    ' Prints the name of the designer by retrieving the DesignerAttribute
    ' from the AttributeCollection. 
    Dim myAttribute As DesignerAttribute = _
        CType(attributes(GetType(DesignerAttribute)), DesignerAttribute)
    Console.WriteLine(("The designer for this class is: " & myAttribute.DesignerTypeName))
    
    Return 0
End Function 'Main

설명

디자인 타임 서비스에 사용하는 클래스는 인터페이스를 IDesigner 구현해야 합니다.

사용 된 DesignerBaseTypeName 디자이너의 기본 형식을 찾으려면 속성입니다. 사용 된 속성을 DesignerTypeName 이 멤버와 연결 된 디자이너 형식의 이름을 가져옵니다.

자세한 내용은 특성을 참조하세요.

생성자

DesignerAttribute(String)

디자인 타임 서비스를 제공하는 형식의 이름을 사용하여 DesignerAttribute 클래스의 새 인스턴스를 초기화합니다.

DesignerAttribute(String, String)

디자이너 형식 및 디자이너 기본 클래스를 사용하여 DesignerAttribute 클래스의 새 인스턴스를 초기화합니다.

DesignerAttribute(String, Type)

디자이너 클래스 이름 및 디자이너 기본 클래스를 사용하여 DesignerAttribute 클래스의 새 인스턴스를 초기화합니다.

DesignerAttribute(Type)

디자인 타임 서비스를 제공하는 형식을 사용하여 DesignerAttribute 클래스의 새 인스턴스를 초기화합니다.

DesignerAttribute(Type, Type)

디자이너 형식 및 디자이너 기본 클래스를 사용하여 DesignerAttribute 클래스의 새 인스턴스를 초기화합니다.

속성

DesignerBaseTypeName

이 디자이너의 기본 형식 이름을 가져옵니다.

DesignerTypeName

이 디자이너 특성과 관련된 디자이너 형식 이름을 가져옵니다.

TypeId

이 특성 형식의 고유 ID를 가져옵니다.

메서드

Equals(Object)

주어진 개체의 값이 현재 DesignerAttribute와 같은지 여부를 반환합니다.

GetHashCode()

이 인스턴스의 해시 코드를 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
IsDefaultAttribute()

파생 클래스에서 재정의된 경우 이 인스턴스 값이 파생 클래스에 대한 기본값인지 여부를 표시합니다.

(다음에서 상속됨 Attribute)
Match(Object)

파생 클래스에서 재정의된 경우 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Attribute)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

이름 집합을 해당하는 디스패치 식별자 집합에 매핑합니다.

(다음에서 상속됨 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

인터페이스의 형식 정보를 가져오는 데 사용할 수 있는 개체의 형식 정보를 검색합니다.

(다음에서 상속됨 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

개체에서 제공하는 형식 정보 인터페이스의 수를 검색합니다(0 또는 1).

(다음에서 상속됨 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

개체에서 노출하는 메서드와 속성에 대한 액세스를 제공합니다.

(다음에서 상속됨 Attribute)

적용 대상

추가 정보