Rule Rule Rule Rule Class


Used to represent the schema information for a Tool, a Custom Build Rule, a PropertyPage, and so on.

public ref class Rule sealed : Microsoft::Build::Framework::XamlTypes::RuleSchema, Microsoft::Build::Framework::XamlTypes::IProjectSchemaNode, System::ComponentModel::ISupportInitialize
public sealed class Rule : Microsoft.Build.Framework.XamlTypes.RuleSchema, Microsoft.Build.Framework.XamlTypes.IProjectSchemaNode, System.ComponentModel.ISupportInitialize
type Rule = class
    inherit RuleSchema
    interface ISupportInitialize
    interface IProjectSchemaNode
Public NotInheritable Class Rule
Inherits RuleSchema
Implements IProjectSchemaNode, ISupportInitialize


Typically represented on disk as XAML, only one instance of this class is maintained per XAML file per project engine (solution).

If you manually instantiate this class, call BeginInit before you set the first property of the object and EndInit after you set the last property.


Rule() Rule() Rule() Rule()

Parameterless constructor. Required for deserialization from a persisted format.


AdditionalInputs AdditionalInputs AdditionalInputs AdditionalInputs

When this Rule represents a Build Customization, this field defines the semicolon-separated list of additional inputs to be evaluated for the Build Customization target.

Categories Categories Categories Categories

Gets or sets the list of Category categories that the properties in this Rule belong to.

CommandLine CommandLine CommandLine CommandLine

When this Rule represents a Build Customization, this field represents the command-line template to be used by a Build Customization task to invoke the tool.

DataSource DataSource DataSource DataSource

The DataSource for the properties in this Rule. This is overridden by any data source that is defined locally for a property.

Description Description Description Description

Gets or sets a description of this Rule for use by a prospective UI client.

DisplayName DisplayName DisplayName DisplayName

Gets or sets a name that can be used by a prospective UI client to display this BaseProperty.

EvaluatedCategories EvaluatedCategories EvaluatedCategories EvaluatedCategories

Returns the union of XAML specified Category categories and auto-generated Category categories. The latter are created from any missing categories that are referred to by the properties in this Rule. The auto-generated Category categories only have their names set.

ExecutionDescription ExecutionDescription ExecutionDescription ExecutionDescription

When this Rule represents a Build Customization, this field represents the message to be displayed before a Build Customization is executed during the build.

FileExtension FileExtension FileExtension FileExtension

When this Rule represents a Build Customization, this field represents the file name extension to associate.

HelpString HelpString HelpString HelpString

Gets or sets Help information for this Rule.

Metadata Metadata Metadata Metadata

Gets or sets arbitrary metadata that may be set on a rule.

Name Name Name Name

The name of this Rule.

Order Order Order Order

Gets or sets a suggestion to a prospective UI client for the relative location of this Rule compared to all other Rules in the system.

Outputs Outputs Outputs Outputs

When this Rule represents a Build Customization, this field defines the semicolon-separated list of outputs that are to be evaluated for the Build Customization target.

OverrideMode OverrideMode OverrideMode OverrideMode

Gets or sets the method to use when multiple rules with the same name appear in the project to reconcile the rules into one instance.

PageTemplate PageTemplate PageTemplate PageTemplate

Gets or sets the UI rendering template that is used to display this Rule.

Properties Properties Properties Properties

Gets or sets the list of properties in this Rule.

PropertyPagesHidden PropertyPagesHidden PropertyPagesHidden PropertyPagesHidden

Gets or sets a flag indicating whether property pages for this rule are hidden.

Separator Separator Separator Separator

Gets or sets a token that is used to separate a property switch from its value.

ShowOnlyRuleProperties ShowOnlyRuleProperties ShowOnlyRuleProperties ShowOnlyRuleProperties

Gets or sets a flag that determines whether to hide the command-line category.

SupportsFileBatching SupportsFileBatching SupportsFileBatching SupportsFileBatching

Gets or sets a flag that determines whether multiple files can be batched on one command-line invocation.

SwitchPrefix SwitchPrefix SwitchPrefix SwitchPrefix

Gets or sets the prefix to use for all property switches in this Rule for the case when this property Rule represents a tool.

ToolName ToolName ToolName ToolName

Gets or sets the name of the tool when this rule represents a tool.


BeginInit() BeginInit() BeginInit() BeginInit()

See BeginInit().

EndInit() EndInit() EndInit() EndInit()

See EndInit().

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetPropertiesByCategory() GetPropertiesByCategory() GetPropertiesByCategory() GetPropertiesByCategory()

Returns a dictionary of all properties partitioned into categories.

GetPropertiesInCategory(String) GetPropertiesInCategory(String) GetPropertiesInCategory(String) GetPropertiesInCategory(String)

Returns the list of properties in a Category.

GetProperty(String) GetProperty(String) GetProperty(String) GetProperty(String)

Gets the property with the specified name.

GetSchemaObjects(Type) GetSchemaObjects(Type) GetSchemaObjects(Type) GetSchemaObjects(Type)

Returns an enumerator over all instances of static data that have the given type.

GetSchemaObjectTypes() GetSchemaObjectTypes() GetSchemaObjectTypes() GetSchemaObjectTypes()

Returns an enumerator over all types of static data for the data-driven features that this node contains.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to