HelpKeywordAttribute クラス

定義

クラスまたはメンバーのコンテキスト キーワードを指定します。 このクラスは継承できません。

public ref class HelpKeywordAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.All, AllowMultiple=false, Inherited=false)]
public sealed class HelpKeywordAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.All, AllowMultiple=false, Inherited=false)]
[System.Serializable]
public sealed class HelpKeywordAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.All, AllowMultiple=false, Inherited=false)>]
type HelpKeywordAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.All, AllowMultiple=false, Inherited=false)>]
[<System.Serializable>]
type HelpKeywordAttribute = class
    inherit Attribute
Public NotInheritable Class HelpKeywordAttribute
Inherits Attribute
継承
HelpKeywordAttribute
属性

次のコード例は、 属性をメンバー自体に配置することで、このヘルプ システムの動作をオーバーライドする方法を示しています。 これらは、 と呼ばれる DemoComponent次のクラスのキーワードです。

  • Class キーワード: "System.ComponentModel.Component" (DemoNamespace.DemoComponent)

  • Property1 キーワード: "DemoNamespace.DemoComponent.Property1" (既定値)

  • Property2 キーワード: "SomeNamespace.SomeOtherClass.Property2" (DemoNamespace.DemoComponent.Property2)

[HelpKeywordAttribute(typeof(Component))]  
public class DemoComponent : Component  
{  
    public string Property1  
    {  
        get  
        {  
            return "";  
        }  
    }  

    [HelpKeywordAttribute("SomeNamespace.SomeOtherClass.Property2")]  
    public string Property2  
    {  
        get  
        {  
            return "";  
        }  
    }  
}  

次のコード例では、 クラスを HelpKeywordAttribute 使用してコンテキスト キーワードを指定する方法を示します。 このコード例の詳細については、「方法: Windows フォーム コントロールで属性を適用する」を参照してください。

// This control demonstrates a simple logging capability. 
[ComplexBindingProperties("DataSource", "DataMember")]
[DefaultBindingProperty("TitleText")]
[DefaultEvent("ThresholdExceeded")]
[DefaultProperty("Threshold")]
[HelpKeywordAttribute(typeof(UserControl))]
[ToolboxItem("System.Windows.Forms.Design.AutoSizeToolboxItem,System.Design")]
public class AttributesDemoControl : UserControl
{
' This control demonstrates a simple logging capability. 
<ComplexBindingProperties("DataSource", "DataMember"), _
DefaultBindingProperty("TitleText"), _
DefaultEvent("ThresholdExceeded"), _
DefaultProperty("Threshold"), _
HelpKeywordAttribute(GetType(UserControl)), _
ToolboxItem("System.Windows.Forms.Design.AutoSizeToolboxItem,System.Design")> _
Public Class AttributesDemoControl
    Inherits UserControl

注釈

既定では、クラスの Help キーワードはプロパティ値によって Type.FullName 指定されます。 メンバーの場合、Help キーワードは、プロパティを宣言した型の完全な名前と、プロパティ名自体によって指定されます。

たとえば、 コントロールの Control.Text プロパティを System.Windows.Forms.Button 考えてみましょう。 class キーワードは "System.Windows.Forms.Button" ですがControl.Text、プロパティキーワードは "System.Windows.Forms.Control.Text" です。これは、 プロパティがクラス自体System.Windows.Forms.Buttonではなく System.Windows.Forms.Button クラスでSystem.Windows.Forms.Control宣言されているためControl.Textです。クラスは プロパティを継承します。

これに対し Button.DialogResult 、 プロパティは クラスで System.Windows.Forms.Button 宣言されているため、そのキーワードは "System.Windows.Forms.Button.DialogResult" です。

ヘルプ システムがキーワードを取得すると、最初に が表示 HelpKeywordAttributeされます。 クラス レベルでは、 によって HelpKeywordAttribute指定された文字列が返されます。 これは、問題の型のメンバーには使用されません。これは、宣言中の型の実際の完全名とメンバー名を反映します。 この属性は、共通のドキュメントが関連付けられているが、個別のヘルプ ID を持つ厳密に型指定されたクラスをサポートします。

コンストラクター

HelpKeywordAttribute()

HelpKeywordAttribute クラスの新しいインスタンスを初期化します。

HelpKeywordAttribute(String)

HelpKeywordAttribute クラスの新しいインスタンスを初期化します。

HelpKeywordAttribute(Type)

特定の型の HelpKeywordAttribute クラスの新しいインスタンスを初期化します。

フィールド

Default

HelpKeywordAttribute の既定値を表します。 このフィールドは読み取り専用です。

プロパティ

HelpKeyword

この属性で指定されたヘルプ キーワードを取得します。

TypeId

派生クラスで実装されると、この Attribute の一意の識別子を取得します。

(継承元 Attribute)

メソッド

Equals(Object)

2 つの HelpKeywordAttribute インスタンスが等しいかどうかを判断します。

GetHashCode()

このインスタンスのハッシュ コードを返します。

GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

ヘルプ キーワードが null かどうかを判断します。

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)

適用対象