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

<SerializableAttribute> _ <AttributeUsageAttribute(AttributeTargets.All, AllowMultiple:=False, Inherited:=False)> _ Public NotInheritable Class HelpKeywordAttribute Inherits Attribute
[SerializableAttribute] [AttributeUsageAttribute(AttributeTargets.All, AllowMultiple=false, Inherited=false)] public sealed class HelpKeywordAttribute : Attribute
[SerializableAttribute] [AttributeUsageAttribute(AttributeTargets::All, AllowMultiple=false, Inherited=false)] public ref class HelpKeywordAttribute sealed : public Attribute

既定では、クラスのヘルプ キーワードは、Type.FullName プロパティ値によって提供されます。メンバの場合、ヘルプ キーワードは、プロパティを宣言した型の完全名にプロパティ名自体を加えて指定されます。
たとえば、System.Windows.Forms.Button コントロールの Control.Text プロパティを例に説明します。クラス キーワードは "System.Windows.Forms.Button" ですが、Control.Text プロパティ キーワードは "System.Windows.Forms.Control.Text" です。これは、Control.Text プロパティが System.Windows.Forms.Button クラス自体ではなく、System.Windows.Forms.Control クラスで宣言されており、System.Windows.Forms.Button クラスはこのプロパティを継承するためです。
これに対して、Button.DialogResult プロパティは System.Windows.Forms.Button クラスで宣言されるため、そのキーワードは "System.Windows.Forms.Button.DialogResult" になります。
ヘルプ システムはキーワードを取得すると、最初に HelpKeywordAttribute を参照します。クラス レベルでは、HelpKeywordAttribute で指定されている文字列が返されます。これは、引き続き宣言型の実際の完全名とメンバ名を反映する型のメンバに対しては使用できません。この属性は、共通のドキュメントが関連付けられているが異なるヘルプ ID を持つ、厳密に型指定されたクラスをサポートします。

メンバ自体に属性を配置することによって、このヘルプ システムの動作をオーバーライドする方法を次のコード例に示します。これらは、DemoComponent と呼ばれる、次のクラスのキーワードです。
-
クラス キーワード : "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(GetType(UserControl)), _ ToolboxItem("System.Windows.Forms.Design.AutoSizeToolboxItem,System.Design")> _ Public Class AttributesDemoControl Inherits UserControl
// 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 {

System.Attribute
System.ComponentModel.Design.HelpKeywordAttribute


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


- HelpKeywordAttribute クラスのページへのリンク