ProvideCodeGeneratorAttribute クラス
カスタム ツールを提供する Visual Studio 拡張機能のパッケージ クラスにこの属性を適用する必要があります。
この API は、CLS に準拠していません。
継承階層
System.Object
System.Attribute
Microsoft.VisualStudio.Shell.RegistrationAttribute
Microsoft.VisualStudio.TextTemplating.VSHost.ProvideCodeGeneratorAttribute
名前空間: Microsoft.VisualStudio.TextTemplating.VSHost
アセンブリ: Microsoft.VisualStudio.TextTemplating.VSHost.11.0 (Microsoft.VisualStudio.TextTemplating.VSHost.11.0.dll 内)
構文
'宣言
<CLSCompliantAttribute(False)> _
<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple := True, Inherited := False)> _
Public NotInheritable Class ProvideCodeGeneratorAttribute _
Inherits RegistrationAttribute
[CLSCompliantAttribute(false)]
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public sealed class ProvideCodeGeneratorAttribute : RegistrationAttribute
[CLSCompliantAttribute(false)]
[AttributeUsageAttribute(AttributeTargets::Class, AllowMultiple = true, Inherited = false)]
public ref class ProvideCodeGeneratorAttribute sealed : public RegistrationAttribute
[<Sealed>]
[<CLSCompliantAttribute(false)>]
[<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true, Inherited = false)>]
type ProvideCodeGeneratorAttribute =
class
inherit RegistrationAttribute
end
public final class ProvideCodeGeneratorAttribute extends RegistrationAttribute
ProvideCodeGeneratorAttribute 型で公開されるメンバーは以下のとおりです。
コンストラクター
名前 | 説明 | |
---|---|---|
![]() |
ProvideCodeGeneratorAttribute |
このページのトップへ
プロパティ
名前 | 説明 | |
---|---|---|
![]() |
Description | ユーザーが判読できる、このジェネレーターの説明 |
![]() |
GeneratesDesignTimeSource | true の場合、このコード ジェネレーターはデザイン時のソース コードを提供します |
![]() |
Name | このジェネレーターの名前。このジェネレーターをソリューション エクスプローラーのファイルに適用するには、[カスタム ツール] プロパティをこの名前に設定します。 |
![]() |
ProjectSystem | このコード ジェネレーターが登録されるプロジェクト システム。 |
![]() |
RegisterCodeBase | true の場合、ジェネレーターはコードベース (特定のアセンブリ ファイルの場所) を使用して登録されます。false の場合、アセンブリは GAC にあります。 |
![]() |
Type | コード ジェネレーターを実装する型 |
![]() |
TypeId | (RegistrationAttribute から継承されます。) |
このページのトップへ
メソッド
名前 | 説明 | |
---|---|---|
![]() |
Equals | インフラストラクチャ。このインスタンスが、指定したオブジェクトに等しいかどうかを示す値を返します。 (Attribute から継承されます。) |
![]() |
GetHashCode | 対象のインスタンスのハッシュ コードを返します。 (Attribute から継承されます。) |
![]() |
GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() |
IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 (Attribute から継承されます。) |
![]() |
Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。) |
![]() |
Register | (RegistrationAttribute.Register(RegistrationAttribute.RegistrationContext) をオーバーライドします。) |
![]() |
ToString | 現在のオブジェクトを表す文字列を返します。 (Object から継承されます。) |
![]() |
Unregister | (RegistrationAttribute.Unregister(RegistrationAttribute.RegistrationContext) をオーバーライドします。) |
このページのトップへ
フィールド
名前 | 説明 | |
---|---|---|
![]() ![]() |
AspNetProjectGuid | ASP.Net プロジェクト システム パッケージの GUID |
![]() ![]() |
CSharpProjectGuid | C# プロジェクト システム パッケージの GUID |
![]() ![]() |
VisualBasicProjectGuid | Visual Basic プロジェクト システム パッケージの GUID |
このページのトップへ
明示的インターフェイスの実装
名前 | 説明 | |
---|---|---|
![]() ![]() |
_Attribute.GetIDsOfNames | 一連の名前を対応する一連のディスパッチ識別子に割り当てます。 (Attribute から継承されます。) |
![]() ![]() |
_Attribute.GetTypeInfo | オブジェクトの型情報を取得します。この情報はインターフェイスの型情報の取得に使用できます。 (Attribute から継承されます。) |
![]() ![]() |
_Attribute.GetTypeInfoCount | オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。 (Attribute から継承されます。) |
![]() ![]() |
_Attribute.Invoke | オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。 (Attribute から継承されます。) |
このページのトップへ
解説
この属性は、カスタム ツールとして Visual Studio 拡張機能を登録します。この属性を持つ拡張機能をユーザーがインストールする場合、ユーザーはこれを使用し、ソリューション エクスプローラーの [カスタム ツールの実行] を使ってファイルを生成できます。
この属性は、単一ファイル ジェネレーターの登録 に記載されている登録タスクを自動的に行います。
パッケージ クラスに属性を適用します (ジェネレーター クラスではない)。
「ProvideCodeGeneratorExtensionAttribute」も参照してください。
例
[ProvideCodeGenerator(typeof(MyGenerator), "MyCustomTool", "My custom tool", true, ProjectSystem = ProvideCodeGeneratorAttribute.CSharpProjectGuid)]
internal sealed partial class MyPackage : Microsoft.VisualStudio.Shell
.Package
{ ... }
internal class MyGenerator : Microsoft.VisualStudio.Shell.Interop.IVsSingleFileGenerator
{ ... }
スレッド セーフ
この型のすべてのパブリック static (Visual Basic では Shared) メンバーは、スレッド セーフです。インスタンス メンバーの場合は、スレッド セーフであるとは限りません。