IVsPersistSolutionProps.ReadSolutionProps 方法

定义

从其 .sln 文件中读取解决方案属性。

public:
 int ReadSolutionProps(Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ pHierarchy, System::String ^ pszProjectName, System::String ^ pszProjectMk, System::String ^ pszKey, int fPreLoad, Microsoft::VisualStudio::OLE::Interop::IPropertyBag ^ pPropBag);
public:
 int ReadSolutionProps(Microsoft::VisualStudio::Shell::Interop::IVsHierarchy ^ pHierarchy, Platform::String ^ pszProjectName, Platform::String ^ pszProjectMk, Platform::String ^ pszKey, int fPreLoad, Microsoft::VisualStudio::OLE::Interop::IPropertyBag ^ pPropBag);
int ReadSolutionProps(Microsoft::VisualStudio::Shell::Interop::IVsHierarchy const & pHierarchy, std::wstring const & pszProjectName, std::wstring const & pszProjectMk, std::wstring const & pszKey, int fPreLoad, Microsoft::VisualStudio::OLE::Interop::IPropertyBag const & pPropBag);
public int ReadSolutionProps (Microsoft.VisualStudio.Shell.Interop.IVsHierarchy pHierarchy, string pszProjectName, string pszProjectMk, string pszKey, int fPreLoad, Microsoft.VisualStudio.OLE.Interop.IPropertyBag pPropBag);
abstract member ReadSolutionProps : Microsoft.VisualStudio.Shell.Interop.IVsHierarchy * string * string * string * int * Microsoft.VisualStudio.OLE.Interop.IPropertyBag -> int
Public Function ReadSolutionProps (pHierarchy As IVsHierarchy, pszProjectName As String, pszProjectMk As String, pszKey As String, fPreLoad As Integer, pPropBag As IPropertyBag) As Integer

参数

pHierarchy
IVsHierarchy

中指向接口的指针 IVsHierarchynull 对于 preSolution 或 global 节,因为如果解决方案尚不存在,或者如果要加载的部分是全局的,则该层次结构不存在。

pszProjectName
String

[in] null 对于全局部分,这意味着解决方案的全局部分的负载 ( .sln) 文件。

pszProjectMk
String

[in] null 对于全局部分,这意味着解决方案的全局部分的负载 ( .sln) 文件。

pszKey
String

中解决方案的属性集的名称,即其属性包。

fPreLoad
Int32

中指示 ReadSolutionProps(IVsHierarchy, String, String, String, Int32, IPropertyBag) 调用是来自预加载部分还是加载后部分。

pPropBag
IPropertyBag

中指向接口的指针 IPropertyBag

返回

Int32

如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。

注解

COM 签名

从 vsshell:

HRESULT IVsPersistSolutionProps::ReadSolutionProps(  
   [in] IVsHierarchy *pHierarchy,  
   [in] LPCOLESTR pszProjectName,  
   [in] LPCOLESTR pszProjectMk,  
   [in] LPCOLESTR pszKey,  
   [in] BOOL fPreLoad,  
   [in] IPropertyBag *pPropBag  
);  

在加载解决方案文件时由环境调用,因此它可以使用注册表将映射 pszKey 到特定的 VSPackage。

适用于