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

<AttributeUsageAttribute(AttributeTargets.All, AllowMultiple:=True, Inherited:=True)> _ Public NotInheritable Class EditorAttribute Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.All, AllowMultiple=true, Inherited=true)] public sealed class EditorAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::All, AllowMultiple=true, Inherited=true)] public ref class EditorAttribute sealed : public Attribute

プロパティを編集する場合、ビジュアル デザイナはダイアログ ボックスまたはドロップダウン ウィンドウを使用して、指定したエディタの新しいインスタンスを作成する必要があります。
このエディタの基本の型を検索するには、EditorBaseTypeName プロパティを使用します。使用できる基本型は UITypeEditor だけです。
この属性と関連付けられたエディタの型名を取得するには、EditorTypeName プロパティを使用します。
属性の使用方法については、「属性の概要」と「属性を使用したメタデータの拡張」を参照してください。デザイン時の属性の詳細については、「属性とデザイン時サポート」を参照してください。

MyImage クラスを作成するコード例を次に示します。このクラスは、エディタとして ImageEditor を指定する EditorAttribute を使用してマークされています。
<Editor("System.Windows.Forms.ImageEditorIndex, System.Design", _ GetType(UITypeEditor))> _ Public Class MyImage ' Insert code here. End Class 'MyImage
[Editor("System.Windows.Forms.ImageEditorIndex, System.Design", typeof(UITypeEditor))] public class MyImage { // Insert code here. }
[Editor("System.Windows.Forms.ImageEditorIndex, System.Design", UITypeEditor::typeid)] public ref class MyImage{ // Insert code here. };
/** @attribute Editor("System.Windows.Forms.ImageEditorIndex, " + "System.Design", UITypeEditor.class) */ public static class MyImage { // Insert code here. } //MyImage
MyImage クラスのインスタンスを作成し、そのクラスの属性を取得し、myNewImage によって使用されるエディタの名前を出力します。
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 'Main
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; }
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 void main(String[] args) { // 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.get_Item(EditorAttribute.class.ToType())); Console.WriteLine("The editor for this class is: " + myAttribute.get_EditorTypeName()); } //main

System.Attribute
System.ComponentModel.EditorAttribute


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EditorAttribute コンストラクタ ()
アセンブリ: System (system.dll 内)


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EditorAttribute コンストラクタ (Type, Type)
アセンブリ: System (system.dll 内)


type パラメータで表される Type は、基本クラスから派生するか、または基本クラスを実装する必要があります。
1 つのデータ型に複数のエディタを関連付けることができるため、baseType パラメータが特定のエディタを見つけるためのキーとして使用されます。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EditorAttribute コンストラクタ (String, String)
アセンブリ: System (system.dll 内)

Dim typeName As String Dim baseTypeName As String Dim instance As New EditorAttribute(typeName, baseTypeName)

typeName パラメータは、Type.AssemblyQualifiedName の形式で指定する必要があります。
typeName パラメータで表される Type は、基本クラスから派生するか、または基本クラスを実装する必要があります。
1 つのデータ型に複数のエディタを関連付けることができるため、baseTypeName パラメータが表す Type が、特定のエディタを見つけるためのキーとして使用されます。これには任意のクラスを使用できますが、通常 UITypeEditor または ComponentEditor を使用します。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EditorAttribute コンストラクタ

名前 | 説明 |
---|---|
EditorAttribute () | 既定のエディタを指定して、EditorAttribute クラスの新しいインスタンスを初期化します。つまり、エディタは指定されません。 |
EditorAttribute (String, String) | エディタの型名と基本型名を指定して、EditorAttribute クラスの新しいインスタンスを初期化します。 |
EditorAttribute (String, Type) | 型名と基本型を指定して、EditorAttribute クラスの新しいインスタンスを初期化します。 |
EditorAttribute (Type, Type) | 型と基本型を指定して、EditorAttribute クラスの新しいインスタンスを初期化します。 |

EditorAttribute コンストラクタ (String, Type)
アセンブリ: System (system.dll 内)


typeName パラメータは、Type.AssemblyQualifiedName の形式で指定する必要があります。
typeName で表される Type は、基本クラスから派生するか、または基本クラスを実装する必要があります。
1 つのデータ型に複数のエディタを関連付けることができるため、baseType パラメータが特定のエディタを見つけるためのキーとして使用されます。

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


EditorAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | EditorBaseTypeName | エディタを検索するためのキーとして使用する基本クラスまたは基本インターフェイスの名前を取得します。 |
![]() | EditorTypeName | Type.AssemblyQualifiedName 形式のエディタ クラス名を取得します。 |
![]() | TypeId | オーバーライドされます。 この属性型の一意の ID を取得します。 |

EditorAttribute メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 オーバーライドされます。 指定したオブジェクトの値が現在の EditorAttribute と等しいかどうかを示す値を返します。 |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 ( Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 ( Attribute から継承されます。) |
![]() | GetHashCode | オーバーライドされます。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 ( Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 ( Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 ( Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

EditorAttribute メンバ
プロパティを変更するために使用するエディタを指定します。このクラスは継承できません。
EditorAttribute データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | EditorBaseTypeName | エディタを検索するためのキーとして使用する基本クラスまたは基本インターフェイスの名前を取得します。 |
![]() | EditorTypeName | Type.AssemblyQualifiedName 形式のエディタ クラス名を取得します。 |
![]() | TypeId | オーバーライドされます。 この属性型の一意の ID を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 オーバーライドされます。 指定したオブジェクトの値が現在の EditorAttribute と等しいかどうかを示す値を返します。 |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 (Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 (Attribute から継承されます。) |
![]() | GetHashCode | オーバーライドされます。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 (Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 (Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- EditorAttributeのページへのリンク