ProvideServiceAttribute 类  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
此属性指示包在应用于 的 Package 子类或实现 IVsPackage的类时提供服务。
public ref class ProvideServiceAttribute sealed : Microsoft::VisualStudio::Shell::ProvideServiceAttributeBasepublic ref class ProvideServiceAttribute sealed : Microsoft::VisualStudio::Shell::ProvideServiceAttributeBase[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)]
public sealed class ProvideServiceAttribute : Microsoft.VisualStudio.Shell.ProvideServiceAttributeBase[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true, Inherited=true)>]
type ProvideServiceAttribute = class
    inherit ProvideServiceAttributeBasePublic NotInheritable Class ProvideServiceAttribute
Inherits ProvideServiceAttributeBase- 继承
- 属性
注解
使用此属性定义的服务将在“服务”注册表项下注册。
构造函数
| ProvideServiceAttribute(Object) | 初始化 ProvideServiceAttribute 的新实例。 | 
属性
| IsAsyncQueryable | 如果服务支持通过异步服务提供程序检索,则为 Deterimines。(继承自 ProvideServiceAttributeBase) | 
| IsCacheable | 向 shell 服务层指示它可以缓存服务。 这更像 MPF 提供的服务的形式,因为 MPF 本身会缓存服务,因此永远不会多次调用服务创建回调。 这将通过消除针对服务请求的本机> 托管转换来提供略微的性能改进。 如果没有令人信服的理由将其设置为 false,则应将其设置为 true。 将来的版本可能会默认为 true。(继承自 ProvideServiceAttributeBase) | 
| IsFreeThreaded | 如果支持从任何线程检索和使用服务,则为 Deterimines。(继承自 ProvideServiceAttributeBase) | 
| Service | 服务的类型。(继承自 ProvideServiceAttributeBase) | 
| ServiceName | 服务名称(继承自 ProvideServiceAttributeBase) | 
| ServiceType | 获取在此属性中声明的服务 GUID。(继承自 ProvideServiceAttributeBase) | 
| TypeId | 重写 TypeID 属性,以便让 RegistrationAttribute 派生类与 System.ComponentModel.TypeDescriptor.GetAttributes 一起使用 (...) 。仅当派生自此属性的属性需要对可应用于类的实例使用更好的控件时,它才必须重写此属性。(继承自 RegistrationAttribute) | 
方法
| GetPackageRegKeyPath(Guid) | 获取相对于 VSPackage 的应用程序) 注册表根目录 (注册表路径。(继承自 RegistrationAttribute) | 
| Register(RegistrationAttribute+RegistrationContext) | 将此属性注册到给定上下文。(继承自 ProvideServiceAttributeBase) | 
| Unregister(RegistrationAttribute+RegistrationContext) | 取消注册此属性。(继承自 ProvideServiceAttributeBase) |