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,每個專案引擎(方案)每個 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

取得或設定這個 Rule 的描述,供潛在 UI 用戶端使用。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()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於