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

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

デザイン時サービスに使用するクラスは、IDesigner インターフェイスを実装している必要があります。
デザイナの基本型を検索するには、DesignerBaseTypeName プロパティを使用します。このメンバと関連付けられたデザイナの型名を取得するには、DesignerTypeName プロパティを使用します。

MyForm というクラスを作成する方法を次の例に示します。MyForm には、このクラスが DocumentDesigner を使用することを指定する DesignerAttribute と、Form カテゴリを指定する DesignerCategoryAttribute という 2 つの属性があります。
<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 'MyForm
[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" , IRootDesigner::typeid), DesignerCategory("Form")] ref class MyForm: public ContainerControl{ // Insert code here. };
/** @attribute Designer("System.Windows.Forms.Design.DocumentDesigner,"+ "System.Windows.Forms.Design.DLL", IRootDesigner.class) @attribute DesignerCategory("Form") */ public static class MyForm extends ContainerControl { // Insert code here. } //MyForm
MyForm のインスタンスを作成する例を次に示します。そのクラスの属性を取得し、DesignerAttribute を抽出してから、デザイナの名前を出力します。
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
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; }
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 void main(String[] args) { // 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.get_Item(DesignerAttribute.class.ToType())); Console.WriteLine(("The designer for this class is: " + myAttribute.get_DesignerTypeName())); } //main

System.Attribute
System.ComponentModel.DesignerAttribute


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


DesignerAttribute コンストラクタ (Type)
アセンブリ: 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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

Dim designerTypeName As String Dim designerBaseType As Type Dim instance As New DesignerAttribute(designerTypeName, designerBaseType)

デザイン時サービスに使用するクラスは、IDesigner インターフェイスを実装している必要があります。
designerBaseType パラメータを使用すると、特定のクラスに対して複数の型のデザイナを結び付けることができます。

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


DesignerAttribute コンストラクタ (String)
アセンブリ: 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DesignerAttribute コンストラクタ

名前 | 説明 |
---|---|
DesignerAttribute (String) | デザイン時サービスを提供する型の名前を指定して、DesignerAttribute クラスの新しいインスタンスを初期化します。 |
DesignerAttribute (Type) | デザイン時サービスを提供する型を指定して、DesignerAttribute クラスの新しいインスタンスを初期化します。 |
DesignerAttribute (String, String) | デザイナの型とデザイナの基本クラスを指定して、DesignerAttribute クラスの新しいインスタンスを初期化します。 |
DesignerAttribute (String, Type) | デザイナ クラスの名前とデザイナの基本クラスを指定して、DesignerAttribute クラスの新しいインスタンスを初期化します。 |
DesignerAttribute (Type, Type) | デザイナの型とデザイナ基本クラスを指定して、DesignerAttribute クラスの新しいインスタンスを初期化します。 |

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

Dim designerType As Type Dim designerBaseType As Type Dim instance As New DesignerAttribute(designerType, designerBaseType)

デザイン時サービスに使用するクラスは、IDesigner インターフェイスを実装している必要があります。
designerBaseType パラメータを使用すると、特定のクラスに対して複数の型のデザイナを結び付けることができます。

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


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

Dim designerTypeName As String Dim designerBaseTypeName As String Dim instance As New DesignerAttribute(designerTypeName, designerBaseTypeName)

デザイン時サービスに使用するクラスは、IDesigner インターフェイスを実装している必要があります。
designerBaseTypeName パラメータを使用すると、特定のクラスに対して複数の型のデザイナを結び付けることができます。

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


DesignerAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | DesignerBaseTypeName | このデザイナの基本型の名前を取得します。 |
![]() | DesignerTypeName | このデザイナ属性と関連付けられているデザイナ型の名前を取得します。 |
![]() | TypeId | オーバーライドされます。 この属性型の一意の ID を取得します。 |

DesignerAttribute メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 オーバーライドされます。 指定したオブジェクトの値が現在の DesignerAttribute と等しいかどうかを示す値を返します。 |
![]() | 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 から継承されます。) |

DesignerAttribute メンバ
コンポーネントに対するデザイン時サービスを実装するために使用するクラスを指定します。
DesignerAttribute データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | DesignerBaseTypeName | このデザイナの基本型の名前を取得します。 |
![]() | DesignerTypeName | このデザイナ属性と関連付けられているデザイナ型の名前を取得します。 |
![]() | TypeId | オーバーライドされます。 この属性型の一意の ID を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 オーバーライドされます。 指定したオブジェクトの値が現在の DesignerAttribute と等しいかどうかを示す値を返します。 |
![]() | 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 から継承されます。) |

- DesignerAttributeのページへのリンク