次の方法で共有


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")]
[HelpKeyword(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 キーワードは、プロパティを宣言した型の完全な名前と、プロパティ名自体によって指定されます。

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

これに対し、 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

この属性によって提供される Help キーワードを取得します。

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)

適用対象