ProvideBindingPathAttribute 类

属性允许其他包装或扩展程序集将使用的 Visual Studio 包装或扩展。 它将包安装地方的目录添加到 Visual Studio 正探测的列表,用来解决程序集引用。

继承层次结构

System.Object
  System.Attribute
    Microsoft.VisualStudio.Shell.RegistrationAttribute
      Microsoft.VisualStudio.Modeling.Shell.ProvideBindingPathAttribute

命名空间:  Microsoft.VisualStudio.Modeling.Shell
程序集:  Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0(在 Microsoft.VisualStudio.Modeling.Sdk.Shell.12.0.dll 中)

语法

声明
<AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple := True, Inherited := True)> _
Public NotInheritable Class ProvideBindingPathAttribute _
    Inherits RegistrationAttribute
[AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public sealed class ProvideBindingPathAttribute : RegistrationAttribute

ProvideBindingPathAttribute 类型公开以下成员。

构造函数

  名称 说明
公共方法 ProvideBindingPathAttribute

页首

属性

  名称 说明
公共属性 SubPath 在 $PackageFolder$ 之后设置的可选子路径。这应用于探测位于不同目录而不是 pkgdef 文件的程序集 。
公共属性 TypeId (继承自 RegistrationAttribute。)

页首

方法

  名称 说明
公共方法 Equals 基础结构。返回一个值,该值指示此实例是否与指定的对象相等。 (继承自 Attribute。)
公共方法 GetHashCode 返回此实例的哈希代码。 (继承自 Attribute。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 IsDefaultAttribute 当在派生类中重写时,指示此实例的值是否是派生类的默认值。 (继承自 Attribute。)
公共方法 Match 当在派生类中重写时,返回一个指示此实例是否等于指定对象的值。 (继承自 Attribute。)
公共方法 Register 注册组件路径(也可为组件路径的子路径)为额外路径,程序集管理器(Visual Studio 中)将探测(在尝试解析程序集时)。安装包时调用。 (重写 RegistrationAttribute.Register(RegistrationAttribute.RegistrationContext)。)
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)
公共方法 Unregister 注销组件路径作为一个绑定路径。卸载包时调用。 (重写 RegistrationAttribute.Unregister(RegistrationAttribute.RegistrationContext)。)

页首

显式接口实现  

  名称 说明
显式接口实现私有方法 _Attribute.GetIDsOfNames 将一组名称映射为对应的一组调度标识符。 (继承自 Attribute。)
显式接口实现私有方法 _Attribute.GetTypeInfo 检索对象的类型信息,然后可以使用该信息获取接口的类型信息。 (继承自 Attribute。)
显式接口实现私有方法 _Attribute.GetTypeInfoCount 检索对象提供的类型信息接口的数量(0 或 1)。 (继承自 Attribute。)
显式接口实现私有方法 _Attribute.Invoke 提供对某一对象公开的属性和方法的访问。 (继承自 Attribute。)

页首

备注

备注

此信息是对应于 Visual Studio 2010。一个替代方法在最新发布可能提供。

如果希望的包或扩展程序集是可见的。其他扩展,应对该特性向包类或程序集。 例如:

[ProvideBindingPath] 
public class MyVsPackage : Microsoft.VisualStudio.Shell.Package 
{ ... }

如果使用可视化和建模 SDK 来创建域特定语言 (DSL),特性在 DslPackage\Package.cs自动应用。

如果未生成 DSL,包括项目中的下列文件:

%VSSDKInstallDir%\VisualStudioIntegration\Common\Source\CSharp\RegistrationAttributes\ProvideBindingPathAttribute.cs

如果包的程序集是在子目录相对于 .pkgdef 文件,则可以使用此变量:

[ProvideBindingPath(SubPath="SubFolder1")] 
public class MyPackage : Microsoft.VisualStudio.Shell.Package 
{ ... }

如果希望指定若干个目录,可以使用多个 ProvideBindingPath 特性。

警告

因为此特性扩展 Visual Studio 查找程序集文件夹的列表,您可能发现该性能的放置,则安装的包。许多此特性

包绑定路径属性如何工作

此特性会在的包的 .pkgdef 文件的输入,在生成"文件夹中找到。 在包安装在目标计算机上,而这会在注册表的项。 注册表项应提供有关探查候选程序集的路径,而其他所有程序集加载时。

例如,.pkgdef 类型类似于:

[$RootKey$\BindingPaths\包 GUID]"$PackageFolder$"=""

包时在目标计算机上安装了,则注册表项在添加 HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\BindingPaths\包 GUID。 输入包括指示包安装的文件夹的字符串特性。

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参阅

参考

Microsoft.VisualStudio.Modeling.Shell 命名空间

Package

其他资源

部署域特定语言解决方案