VCProject.AddRuleDefinition(String, String, Boolean) 方法

定义

向项目中添加一个规则,以使其可用作 IVCRulePropertyStorage

public:
 bool AddRuleDefinition(System::String ^ bstrRuleFilePath, System::String ^ bstrContext, bool bPersistInProject);
public:
 bool AddRuleDefinition(Platform::String ^ bstrRuleFilePath, Platform::String ^ bstrContext, bool bPersistInProject);
bool AddRuleDefinition(std::wstring const & bstrRuleFilePath, std::wstring const & bstrContext, bool bPersistInProject);
[System.Runtime.InteropServices.DispId(882)]
public bool AddRuleDefinition (string bstrRuleFilePath, string bstrContext, bool bPersistInProject);
[<System.Runtime.InteropServices.DispId(882)>]
abstract member AddRuleDefinition : string * string * bool -> bool
Public Function AddRuleDefinition (bstrRuleFilePath As String, bstrContext As String, bPersistInProject As Boolean) As Boolean

参数

bstrRuleFilePath
String

指向包含规则的 XAML 文件的路径。 可以是指向项目的完整路径或相对路径。

bstrContext
String

以分号隔开的上下文列表,此上下文应用此规则。

bPersistInProject
Boolean

指定将 true 规则永久添加到项目中,或 false 仅添加规则直到卸载。

返回

Boolean

true 如果实际上已将规则添加到项目中,则为; 否则为。 false 如果已在项目中定义了该规则,则为。

属性

注解

此方法将 PropertyPageSchema 项添加到项目文件。 未将任何条件附加到已添加的项。

若要阅读刚刚添加的规则,请浏览到 Rules 任何配置。

适用于