CodeGeneratorRegistrationAttribute 类

定义

此属性为特定文件类型添加自定义文件生成器注册表项。 例如:[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Generators
{fae04ec1-301f-11d3-bf4b-00c04f79efbc}\MyGenerator] “CLSID”=“{AAAA53CC-3D4F-40a2-BD4D-4F3419755476}” “GeneratesDesignTimeSource” = d'1'

public ref class CodeGeneratorRegistrationAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
public ref class CodeGeneratorRegistrationAttribute sealed : Microsoft::VisualStudio::Shell::RegistrationAttribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
public sealed class CodeGeneratorRegistrationAttribute : Microsoft.VisualStudio.Shell.RegistrationAttribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
type CodeGeneratorRegistrationAttribute = class
    inherit RegistrationAttribute
Public NotInheritable Class CodeGeneratorRegistrationAttribute
Inherits RegistrationAttribute
继承
CodeGeneratorRegistrationAttribute
属性

注解

例如:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Generators\{fae04ec1-301f-11d3-bf4b-00c04f79efbc}\MyGenerator]

“CLSID”=“{AAAA53CC-3D4F-40a2-BD4D-4F3419755476}”

“GeneratesDesignTimeSource” = d'1'

构造函数

CodeGeneratorRegistrationAttribute(Type, String, String)

创建新的 CodeGeneratorRegistrationAttribute 属性,为提供的上下文注册自定义代码生成器。

属性

ContextGuid

获取表示项目类型的 Guid

GeneratesDesignTimeSource

获取或设置 GeneratesDesignTimeSource 值

GeneratesSharedDesignTimeSource

获取或设置 GeneratesSharedDesignTimeSource 值

GeneratorGuid

获取表示生成器类型的 Guid

GeneratorName

获取生成器名称

GeneratorRegKeyName

获取下的生成器注册表键名称

GeneratorType

获取生成器类型

TypeId

重写 TypeID 属性,以便让 RegistrationAttribute 派生类与 System.ComponentModel.TypeDescriptor.GetAttributes 一起使用 (...) 。仅当派生自此属性的属性需要对可应用于类的实例使用更好的控件时,它才必须重写此属性。

(继承自 RegistrationAttribute)

方法

GetPackageRegKeyPath(Guid)

获取相对于 VSPackage 的应用程序) 注册表根目录 (注册表路径。

(继承自 RegistrationAttribute)
Register(RegistrationAttribute+RegistrationContext)

调用以便向给定的上下文注册此属性。 上下文包含应放置注册信息的位置。 它还包含其他信息,例如正在注册的类型和路径信息。

Unregister(RegistrationAttribute+RegistrationContext)

取消注册此文件扩展名。

适用于