确定文档是否是项目的一部分。
命名空间: Microsoft.VisualStudio.Shell.Interop
程序集: Microsoft.VisualStudio.Shell.Interop(在 Microsoft.VisualStudio.Shell.Interop.dll 中)
语法
声明
Function IsDocumentInAProject ( _
pszMkDocument As String, _
<OutAttribute> ByRef ppUIH As IVsUIHierarchy, _
<OutAttribute> ByRef pitemid As UInteger, _
<OutAttribute> ByRef ppSP As IServiceProvider, _
<OutAttribute> ByRef pDocInProj As Integer _
) As Integer
int IsDocumentInAProject(
string pszMkDocument,
out IVsUIHierarchy ppUIH,
out uint pitemid,
out IServiceProvider ppSP,
out int pDocInProj
)
参数
- pszMkDocument
类型:System.String
[in] 字符串文档的唯一标记标识符形式对项目系统,例如,完整路径到文件。在 URL 的形式,在非文件种情况下,此标识符常常是。
- ppUIH
类型:Microsoft.VisualStudio.Shell.Interop.IVsUIHierarchy%
[out] 如果文档处于打开状态,这是指向包含文档项目的 IVsUIHierarchy 接口实现。如果文档尚未打开,此参数的值是 nullnull 引用(在 Visual Basic 中为 Nothing)。您可以从 IVsUIHierarchy 的 Query Interface 获取指向该项的 IVsHierarchy 接口。
- pitemid
类型:System.UInt32%
[out] 为文档的层次结构项 ID 的指针在项目系统的。有关更多信息,请参见VSITEMID。
- ppSP
类型:Microsoft.VisualStudio.OLE.Interop.IServiceProvider%
[out] 为 IServiceProvider 接口的指针项目的。
- pDocInProj
类型:System.Int32%
[out, retval] 指定的标志文档是否是项目的一部分。有关更多信息,请参见 __VSDOCINPROJECT。
返回值
类型:System.Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。
备注
COM 签名
从 vsshell.idl:
HRESULT IVsUIShellOpenDocument::IsDocumentInAProject(
[in] LPCOLESTR pszMkDocument,
[out] IVsUIHierarchy **ppUIH,
[out] VSITEMID *pitemid,
[out] IServiceProvider **ppSP,
[out, retval] VSDOCINPROJECT *pDocInProj
);
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。