DisplayNameAttribute クラス
アセンブリ: System (system.dll 内)
構文<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Method Or AttributeTargets.Property Or AttributeTargets.Event)> _ Public Class DisplayNameAttribute Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Event)] public class DisplayNameAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Method|AttributeTargets::Property|AttributeTargets::Event)] public ref class DisplayNameAttribute : public Attribute
解説既定値は、プロパティまたはイベントの名前です。GetSortedActionItems の既定の実装は、リフレクションを使用して、引数を受け取らないパブリック プロパティおよびパブリックな void メソッドを検索します。GetSortedActionItems は、各プロパティおよびメソッドの DisplayNameAttribute を検索し、見つかった場合は、プロパティ名やメソッド名の代わりにその文字列を使用します。
使用例DisplayNameAttribute クラスを使用して、PropertyGrid コントロールで、MisnamedProperty と呼ばれるプロパティの名前を RenamedProperty に変更するコード例を次に示します。コード全体については、「方法 : Windows フォーム コントロールに属性を適用する」を参照してください。
' This property exists only to demonstrate the ' DisplayName attribute. When this control ' is attached to a PropertyGrid control, the ' property will be appear as "RenamedProperty" ' instead of "MisnamedProperty". <Description("Demonstrates DisplayNameAttribute."), _ DisplayName("RenamedProperty")> _ Public ReadOnly Property MisnamedProperty() As Boolean Get Return True End Get End Property
// This property exists only to demonstrate the // DisplayName attribute. When this control // is attached to a PropertyGrid control, the // property will be appear as "RenamedProperty" // instead of "MisnamedProperty". [Description("Demonstrates DisplayNameAttribute.")] [DisplayName("RenamedProperty")] public bool MisnamedProperty { get { return true; } }
継承階層System.Attribute
System.ComponentModel.DisplayNameAttribute
スレッド セーフ
プラットフォーム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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照DisplayNameAttribute コンストラクタ ()
アセンブリ: 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照DisplayNameAttribute コンストラクタ (String)
アセンブリ: System (system.dll 内)
構文Public Sub New ( _ displayName As String _ )
Dim displayName As String Dim instance As New DisplayNameAttribute(displayName)
public DisplayNameAttribute ( string displayName )
public: DisplayNameAttribute ( String^ displayName )
public DisplayNameAttribute ( String displayName )
public function DisplayNameAttribute ( displayName : String )
プラットフォーム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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照DisplayNameAttribute コンストラクタ
オーバーロードの一覧| 名前 | 説明 |
|---|---|
| DisplayNameAttribute () | DisplayNameAttribute クラスの新しいインスタンスを初期化します。 |
| DisplayNameAttribute (String) | 表示名を使用して、DisplayNameAttribute クラスの新しいインスタンスを初期化します。 |
参照DisplayNameAttribute フィールド
DisplayNameAttribute プロパティ
パブリック プロパティ| 名前 | 説明 | |
|---|---|---|
| DisplayName | この属性に格納されている引数を受け取らないプロパティ、イベント、またはパブリックな void メソッドの表示名を取得します。 |
| TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。) |
プロテクト プロパティ
参照DisplayNameAttribute メソッド
パブリック メソッド| 名前 | 説明 | |
|---|---|---|
| Equals | オーバーロードされます。 オーバーライドされます。 2 つの DisplayNameAttribute インスタンスが等しいかどうかを判断します。 |
| GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 ( Attribute から継承されます。) |
| GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 ( Attribute から継承されます。) |
| GetHashCode | オーバーライドされます。 このインスタンスのハッシュ コードを返します。 |
| GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
| IsDefaultAttribute | オーバーライドされます。 この属性が既定値かどうかを判断します。 |
| IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 ( Attribute から継承されます。) |
| Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 ( Attribute から継承されます。) |
| ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
| ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |
プロテクト メソッド| 名前 | 説明 | |
|---|---|---|
| Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
参照DisplayNameAttribute メンバ
引数を受け取らないプロパティ、イベント、またはパブリックな void メソッドの表示名を指定します。
DisplayNameAttribute データ型で公開されるメンバを以下の表に示します。
パブリック コンストラクタ
パブリック フィールド
パブリック プロパティ| 名前 | 説明 | |
|---|---|---|
| DisplayName | この属性に格納されている引数を受け取らないプロパティ、イベント、またはパブリックな void メソッドの表示名を取得します。 |
| TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。) |
プロテクト プロパティ
パブリック メソッド| 名前 | 説明 | |
|---|---|---|
| Equals | オーバーロードされます。 オーバーライドされます。 2 つの DisplayNameAttribute インスタンスが等しいかどうかを判断します。 |
| GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 (Attribute から継承されます。) |
| GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 (Attribute から継承されます。) |
| GetHashCode | オーバーライドされます。 このインスタンスのハッシュ コードを返します。 |
| GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
| IsDefaultAttribute | オーバーライドされます。 この属性が既定値かどうかを判断します。 |
| IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 (Attribute から継承されます。) |
| Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。) |
| ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
| ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |
プロテクト メソッド| 名前 | 説明 | |
|---|---|---|
| Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
参照- DisplayNameAttributeのページへのリンク