IVsComponentUser 接口
将元素添加到指定的项目。
命名空间: Microsoft.VisualStudio.Shell.Interop
程序集: Microsoft.VisualStudio.Shell.Interop(在 Microsoft.VisualStudio.Shell.Interop.dll 中)
语法
声明
<InterfaceTypeAttribute()> _
<GuidAttribute("910035B1-D8BE-403A-975E-E4FB68CE40A1")> _
Public Interface IVsComponentUser
[InterfaceTypeAttribute()]
[GuidAttribute("910035B1-D8BE-403A-975E-E4FB68CE40A1")]
public interface IVsComponentUser
IVsComponentUser 类型公开以下成员。
方法
名称 | 说明 | |
---|---|---|
![]() |
AddComponent | 用于通过环境添加用户指定的元素在 组件选择器 对话框添加到指定的项目。 |
页首
备注
IVsComponentUser 与 IVsComponentSelectorDlg一起使用。 若要使用组件选择器对话框的包将实现 IVsComponentUser 并将其传递给 SVsComponentSelectorDlg 服务。
该环境提供标准 添加引用 对话框使用的默认实现。
您实现层次结构中的节点的 IVsComponentUser ,然后调用具有适当的筛选器的 IVsComponentSelectorDlg 从 __VSCOMPSELFLAGS 枚举,请在节点的 IVsComponentUser 接口,显示页的 GUID_NULL (或 GUID_COMPlusPage 过程,如果有一个您只需在上面), nullnull 引用(在 Visual Basic 中为 Nothing) ,如果您在本地计算机上, VSCOMPONENTSELECTORTABINIT 值,文件筛选器枚举,因此,设置初始目录并将它存储的 BSTR 返回。
下面是步骤对于使用 IVsComponentUser 接口。
调用 AddReference的层次结构中 IOleCommandTarget 的用于选择 AddReference 。
命令实现执行 SVsComponentSelectorDlg 的 QueryService 可以查找 IVsComponentSelectorDlg 然后调用与其 IVsComponentUser的实现的 IVsComponentSelectorDlg 。
用户在对话框中选择引用添加并单击 " 添加按钮。
在对话框 AddComponent调用。
AddComponent 的层次结构中实现可视方式添加引用和实际添加到项目中。
支持的项目引用需要实现此接口。
对实现者的说明
实现由若要使用 组件选择器 对话框的所有 VSPackage,如中允许的项目系统添加的用户引用。net 程序集。