EditorAttribute 클래스

정의

속성을 변경하는 데 사용할 편집기를 지정합니다. 이 클래스는 상속될 수 없습니다.

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

예제

다음 코드 예제에서는 클래스를 MyImage 만듭니다. 클래스는 해당 편집기를 EditorAttribute 지정 ImageEditor 하는 클래스로 표시됩니다.

[Editor("System.Windows.Forms.ImageEditorIndex, System.Design",
UITypeEditor::typeid)]
public ref class MyImage{
   // Insert code here.
};
[Editor("System.Windows.Forms.ImageEditorIndex, System.Design", 
    typeof(UITypeEditor))]

public class MyImage
{
    // Insert code here.
 }
<Editor("System.Windows.Forms.ImageEditorIndex, System.Design", _
    GetType(UITypeEditor))> _
Public Class MyImage
    ' Insert code here.
End Class

다음 코드 예제에서는 클래스의 인스턴스를 MyImage 만들고, 클래스에 대한 특성을 가져오고, 사용하는 myNewImage편집기의 이름을 인쇄합니다.

int main()
{
   // Creates a new component.
   MyImage^ myNewImage = gcnew MyImage;

   // Gets the attributes for the component.
   AttributeCollection^ attributes = TypeDescriptor::GetAttributes( myNewImage );

   /* Prints the name of the editor by retrieving the EditorAttribute 
       * from the AttributeCollection. */
   EditorAttribute^ myAttribute = dynamic_cast<EditorAttribute^>(attributes[ EditorAttribute::typeid ]);
   Console::WriteLine( "The editor for this class is: {0}", myAttribute->EditorTypeName );
   return 0;
}
public static int Main() {
    // Creates a new component.
    MyImage myNewImage = new MyImage();
 
    // Gets the attributes for the component.
    AttributeCollection attributes = TypeDescriptor.GetAttributes(myNewImage);
 
    /* Prints the name of the editor by retrieving the EditorAttribute 
     * from the AttributeCollection. */
    
    EditorAttribute myAttribute = (EditorAttribute)attributes[typeof(EditorAttribute)];
    Console.WriteLine("The editor for this class is: " + myAttribute.EditorTypeName);
 
    return 0;
 }
Public Shared Sub Main()
    ' Creates a new component.
    Dim myNewImage As New MyImage()
    
    ' Gets the attributes for the component.
    Dim attributes As AttributeCollection = TypeDescriptor.GetAttributes(myNewImage)
    
    ' Prints the name of the editor by retrieving the EditorAttribute
    ' from the AttributeCollection. 
    
    Dim myAttribute As EditorAttribute = CType(attributes(GetType(EditorAttribute)), EditorAttribute)
    Console.WriteLine(("The editor for this class is: " & myAttribute.EditorTypeName))

End Sub

설명

속성을 편집할 때 비주얼 디자이너는 대화 상자 또는 드롭다운 창을 통해 지정된 편집기의 새 인스턴스를 만들어야 합니다.

EditorBaseTypeName 속성을 사용하여 이 편집기 기본 형식을 찾습니다. 사용 가능한 유일한 기본 형식은 .입니다 UITypeEditor.

속성을 EditorTypeName 사용하여 이 특성과 연결된 편집기 형식의 이름을 가져옵니다.

특성 사용에 대한 일반적인 정보입니다. 특성을 참조하세요. 디자인 타임 특성에 대한 자세한 내용은 특성 및 Design-Time 지원을 참조하세요.

생성자

EditorAttribute()

기본 편집기(편집기 없음)를 사용하여 EditorAttribute 클래스의 새 인스턴스를 초기화합니다.

EditorAttribute(String, String)

편집기의 형식 이름 및 기본 형식 이름을 사용하여 EditorAttribute 클래스의 새 인스턴스를 초기화합니다.

EditorAttribute(String, Type)

형식 이름과 기본 형식을 사용하여 EditorAttribute 클래스의 새 인스턴스를 초기화합니다.

EditorAttribute(Type, Type)

형식과 기본 형식을 사용하여 EditorAttribute 클래스의 새 인스턴스를 초기화합니다.

속성

EditorBaseTypeName

이 편집기의 조회 키로 사용되는 기본 클래스 또는 인터페이스 이름을 가져옵니다.

EditorTypeName

AssemblyQualifiedName 형식의 편집기 클래스 이름을 가져옵니다.

TypeId

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

메서드

Equals(Object)

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

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)

적용 대상