Compartilhar via


VCProject.AddRuleDefinition(String, String, Boolean) Method

Definition

Adds a rule to the project so that it is available as an 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

Parameters

bstrRuleFilePath
String

The path to a XAML file that contains a rule. May be a full path or relative to the project.

bstrContext
String

A semicolon-delimited list of contexts in which this rule applies.

bPersistInProject
Boolean

Specify true to add the rule to the project permanently, or false to add the rule only until it is unloaded.

Returns

true if the rule was actually added to the project; false if the rule was already defined in the project.

Attributes

Remarks

This method adds a PropertyPageSchema item to the project file. No condition is attached to the added item.

To read the rule just added, browse through Rules for any configuration.

Applies to