Rule 类

定义

用于表示工具、自定义生成规则和 PropertyPage 等的架构信息。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
[System.Windows.Markup.ContentProperty("Properties")]
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
继承
属性
实现

注解

通常在磁盘上表示为 XAML,每个项目引擎(解决方案)仅维护此类的一个实例。Typically represented on disk as XAML, only one instance of this class is maintained per XAML file per project engine (solution).

如果手动实例化此类,请BeginInit在设置对象的第一个属性之前和EndInit设置最后一个属性后调用。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()

无参数构造函数。Parameterless constructor. 这是从持久格式进行反序列化所必需的。Required for deserialization from a persisted format.

属性

AdditionalInputs

当此 Rule 表示一个生成自定义项时,此字段定义要针对此生成自定义项目标计算的附加输入的列表(各项之间用分号分隔)。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

获取或设置此 Category 中的属性属于的 Rule 类别的列表。Gets or sets the list of Category categories that the properties in this Rule belong to.

CommandLine

当此 Rule 表示一个生成自定义项时,此字段表示一个命令行模板,生成自定义项任务将使用此模板来调用工具。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 中的属性的 RuleThe DataSource for the properties in this Rule. 在本地为某个属性定义的任何数据源将重写此设置。This is overridden by any data source that is defined locally for a property.

Description

获取或设置供预期的 UI 客户端使用的此 Rule 的说明。Gets or sets a description of this Rule for use by a prospective UI client.

DisplayName

获取或设置可由预期 UI 客户端用来显示此 BaseProperty 的名称。Gets or sets a name that can be used by a prospective UI client to display this BaseProperty.

EvaluatedCategories

返回 XAML 指定的 Category 类别和自动生成的 Category 类别的联合。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. 自动生成的 Category 类别仅设置其名称。The auto-generated Category categories only have their names set.

ExecutionDescription

当此 Rule 表示一个生成自定义项时,此字段表示一条消息,在生成过程中执行一个生成自定义项之前将显示该消息。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

当此 Rule 表示一个生成自定义项时,此字段表示要关联的文件扩展名。When this Rule represents a Build Customization, this field represents the file name extension to associate.

HelpString

获取或设置此 Rule 的帮助信息。Gets or sets Help information for this Rule.

Metadata

获取或设置可能在规则上设置的任意元数据。Gets or sets arbitrary metadata that may be set on a rule.

Name

Rule 的名称。The name of this Rule.

Order

获取或设置提供给预期的 UI 客户端的建议,告知此 Rule 与系统中所有其他规则相比较的相对位置。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

当此 Rule 表示一个生成自定义项时,此字段定义要针对此生成自定义项目标计算的输出的列表(各项之间用分号分隔)。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

获取或设置同一名称的多个规则出现在项目中时要用于将这些规则协调为一个实例的方法。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

获取或设置用于显示此规则的 UI 呈现模板。Gets or sets the UI rendering template that is used to display this Rule.

Properties

获取或设置此 Rule 中的属性的列表。Gets or sets the list of properties in this Rule.

PropertyPagesHidden

获取或设置指示此规则的属性页是否隐藏的标志。Gets or sets a flag indicating whether property pages for this rule are hidden.

Separator

获取或设置用于将一个属性开关与其值分隔的标记。Gets or sets a token that is used to separate a property switch from its value.

ShowOnlyRuleProperties

获取或设置一个标志,该标志确定是否隐藏命令行类别。Gets or sets a flag that determines whether to hide the command-line category.

SupportsFileBatching

获取或设置一个标志,该标志确定是否可以在一个命令行调用中对多个文件进行批处理。Gets or sets a flag that determines whether multiple files can be batched on one command-line invocation.

SwitchPrefix

获取或设置在此属性 Rule 表示一个工具参数的情况下,要对此 Rule 中的所有属性开关使用的前缀。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

获取或设置此规则表示的工具的名称。Gets or sets the name of the tool when this rule represents a tool.

方法

BeginInit()

请参阅 BeginInit()See BeginInit().

EndInit()

请参阅 EndInit()See EndInit().

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetPropertiesByCategory()

返回已划分到各个类别中的所有属性的字典。Returns a dictionary of all properties partitioned into categories.

GetPropertiesInCategory(String)

返回 Category 中的属性的列表。Returns the list of properties in a Category.

GetProperty(String)

获取具有指定名称的属性。Gets the property with the specified name.

GetSchemaObjects(Type)

返回针对具有给定类型的静态数据的所有实例的枚举器。Returns an enumerator over all instances of static data that have the given type.

GetSchemaObjectTypes()

返回针对此节点包含的数据驱动功能的静态数据的所有类型的枚举器。Returns an enumerator over all types of static data for the data-driven features that this node contains.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)

适用于