ProjectItemDefinitionElement 類別

定義

ProjectItemDefinitionElement 類別代表 MSBuild 專案中的 Item Definition 元素。ProjectItemDefinitionElement class represents the Item Definition element in the MSBuild project.

public ref class ProjectItemDefinitionElement : Microsoft::Build::Construction::ProjectElementContainer
public class ProjectItemDefinitionElement : Microsoft.Build.Construction.ProjectElementContainer
type ProjectItemDefinitionElement = class
    inherit ProjectElementContainer
Public Class ProjectItemDefinitionElement
Inherits ProjectElementContainer
繼承
ProjectItemDefinitionElement

屬性

AllChildren

取得所有子項目的列舉程式,以遞迴方式取得。Get an enumerator over all children, gotten recursively. 以深度優先的方式來瀏覽子項目。Walks the children in a depth-first manner.

(繼承來源 ProjectElementContainer)
AllParents

這個項目的所有父項目,向上可達到 ProjectRootElement。All parent elements of this element, going up to the ProjectRootElement. 如果這本身是 ProjectRootElement,則為 None。None if this itself is a ProjectRootElement. 如果這本身尚未附加至父項目,則為 None。None if this itself has not been attached to a parent yet.

(繼承來源 ProjectElement)
Children

取得所有子項目的可列舉項目Get enumerable over all the children

(繼承來源 ProjectElementContainer)
ChildrenReversed

從最後一個開始,取得所有子項目的可列舉項目Get enumerable over all the children, starting from the last

(繼承來源 ProjectElementContainer)
Condition

取得或設定條件值。Gets or sets the Condition value. IFF 條件屬性為合法的,但其不存在或沒有值時會傳回空字串。It will return empty string IFF a condition attribute is legal but it’s not present or has no value. IFF 該項目上條件屬性是不合法的,它會傳回 null。It will return null IFF a Condition attribute is illegal on that element. 如果值設定為空白,則移除屬性。Removes the attribute if the value to set is empty. 如果設定條件並不適用於那些項目,衍生類別可能會擲回 InvalidOperationExceptionIt is possible for derived classes to throw an InvalidOperationException if setting the condition is not applicable for those elements.

(繼承來源 ProjectElement)
ConditionLocation

"Condition" 屬性在這個項目上的位置 (如果有的話)。Location of the "Condition" attribute on this element, if any. 如果沒有這種屬性,則會傳回 null。If there is no such attribute, returns null.

(繼承來源 ProjectElement)
ContainingProject

ProjectRootElement (可能是已匯入),其中包含這個 Xml。ProjectRootElement (possibly imported) that contains this Xml. 不可以是 null。Cannot be null.

(繼承來源 ProjectElement)
Count

任何種類的子項目數目Number of children of any kind

(繼承來源 ProjectElementContainer)
ElementName (繼承來源 ProjectElement)
FirstChild

第一個子項目 (如果有的話),否則為 Null。First child, if any, otherwise null. 無法直接設定;使用 PrependChild(ProjectElement)Cannot be set directly; use PrependChild(ProjectElement).

(繼承來源 ProjectElementContainer)
ItemType

取得定義的類型。Gets the definition's type.

Label

取得或設定標籤值。Gets or sets the Label value. 如果屬性不存在,則會傳回空字串。Returns empty string if it is not present. 如果值設定為空白,則移除屬性。Removes the attribute if the value to set is empty.

(繼承來源 ProjectElement)
LabelLocation

"Label" 屬性在這個項目上的位置 (如果有的話)。Location of the "Label" attribute on this element, if any. 如果沒有這種屬性,則會傳回 null;If there is no such attribute, returns null;

(繼承來源 ProjectElement)
LastChild

最後一個子項目 (如果有的話),否則為 Null。Last child, if any, otherwise null. 無法直接設定;使用 AppendChild(ProjectElement)Cannot be set directly; use AppendChild(ProjectElement).

(繼承來源 ProjectElementContainer)
Location

對應的 Xml 項目的位置。Location of the corresponding Xml element. 如果未儲存檔案,或自從上次儲存之後已編輯檔案,可能不正確。May not be correct if file is not saved, or file has been edited since it was last saved. 如果是未儲存的編輯,位置只會包含項目的來源檔案路徑。In the case of an unsaved edit, the location only contains the path to the file that the element originates from.

(繼承來源 ProjectElement)
Metadata

取得任何子中繼資料定義。Get any child metadata definitions.

NextSibling

下一個同層級項目。Next sibling element. 可能是 Null。May be null.

(繼承來源 ProjectElement)
OuterElement (繼承來源 ProjectElement)
Parent

如果這是 ProjectRootElement,則為 null。Null if this is a ProjectRootElement. 如果它尚未附加至父系,則為 null。Null if this has not been attached to a parent yet.

(繼承來源 ProjectElement)
PreviousSibling

上一個同層級項目。Previous sibling element. 可能是 Null。May be null.

(繼承來源 ProjectElement)

方法

AddMetadata(String, String)

可將中繼資料片段新增至此項目定義的便利方法。Convenience method to add a piece of metadata to this item definition. 在任何現有的中繼資料後面加入。Adds after any existing metadata. 不會修改任何現有的中繼資料。Does not modify any existing metadata.

AddMetadata(String, String, Boolean)

可將中繼資料片段新增至此項目定義的便利方法。Convenience method to add a piece of metadata to this item definition. 在任何現有的中繼資料後面加入。Adds after any existing metadata. 不會修改任何現有的中繼資料。Does not modify any existing metadata.

AppendChild(ProjectElement)

將提供的元素當作最後一個子元素插入。Inserts the provided element as the last child. 如果父項目本身不是父代,則會擲回。Throws if the parent is not itself parented. 如果要新增的節點已經成為父代,則會擲回。Throws if the node to add is already parented. 如果要新增的節點是從與此節點不同的專案所建立的,則會擲回。Throws if the node to add was created from a different project than this node.

(繼承來源 ProjectElementContainer)
Clone()

傳回這個專案元素的淺層複製。Returns a shallow clone of this project element.

(繼承來源 ProjectElement)
Clone(ProjectRootElement)

傳回這個專案元素的淺層複製。Returns a shallow clone of this project element.

(繼承來源 ProjectElement)
CopyFrom(ProjectElement)

將來自指定類型的屬性套用到此執行個體。Applies properties from the specified type to this instance.

(繼承來源 ProjectElement)
CreateNewInstance(ProjectRootElement)
CreateNewInstance(ProjectRootElement)

傳回這個相同類型的新執行個體。Returns a new instance of this same type. 在建立之後無法設定的任何屬性,都應該設定為針對這個執行個體所設定之值的複本。Any properties that cannot be set after creation should be set to copies of values as set for this instance.

(繼承來源 ProjectElement)
DeepClone(ProjectRootElement, ProjectElementContainer)

傳回此專案元素與其所有子元素的複本。Returns a clone of this project element and all its children.

(繼承來源 ProjectElementContainer)
DeepCopyFrom(ProjectElementContainer)

將來自指定類型的屬性套用到此執行個體。Applies properties from the specified type to this instance.

(繼承來源 ProjectElementContainer)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
InsertAfterChild(ProjectElement, ProjectElement)

在參考子項目後面插入子項目。Insert the child after the reference child. 參考子項目 (如果有提供) 必須是此元素的父元素。Reference child if provided must be parented by this element. 參考子項目可能是 Null,在此情況下,這相當於 PrependChild(ProjectElement)Reference child may be null, in which case this is equivalent to PrependChild(ProjectElement). 如果父項目本身不是父代,則會擲回。Throws if the parent is not itself parented. 如果參考節點沒有此節點作為其父項目,則會擲回。Throws if the reference node does not have this node as its parent. 如果要新增的節點已經成為父代,則會擲回。Throws if the node to add is already parented. 如果要新增的節點是從與此節點不同的專案所建立的,則會擲回。Throws if the node to add was created from a different project than this node.

(繼承來源 ProjectElementContainer)
InsertBeforeChild(ProjectElement, ProjectElement)

在參考子項目前面插入子項目。Insert the child before the reference child. 參考子項目 (如果有提供) 必須是此元素的父元素。Reference child if provided must be parented by this element. 參考子項目可能是 Null,在此情況下,這相當於 AppendChild(ProjectElement)Reference child may be null, in which case this is equivalent to AppendChild(ProjectElement). 如果父項目本身不是父代,則會擲回。Throws if the parent is not itself parented. 如果參考節點沒有此節點作為其父項目,則會擲回。Throws if the reference node does not have this node as its parent. 如果要新增的節點已經成為父代,則會擲回。Throws if the node to add is already parented. 如果要新增的節點是從與此節點不同的專案所建立的,則會擲回。Throws if the node to add was created from a different project than this node.

(繼承來源 ProjectElementContainer)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
PrependChild(ProjectElement)

將提供的元素當作第一個子元素插入。Inserts the provided element as the first child. 如果父項目本身不是父代,則會擲回。Throws if the parent is not itself parented. 如果要新增的節點已經成為父代,則會擲回。Throws if the node to add is already parented. 如果要新增的節點是從與此節點不同的專案所建立的,則會擲回。Throws if the node to add was created from a different project than this node.

(繼承來源 ProjectElementContainer)
RemoveAllChildren()

移除所有子項目 (如果有的話)。Remove all the children, if any.

(繼承來源 ProjectElementContainer)
RemoveChild(ProjectElement)

移除指定的子項目。Removes the specified child. 如果子項目目前不是此物件的父項目,則會擲回。Throws if the child is not currently parented by this object. 這是 O(1)。This is O(1). 可以在列舉子項目期間安全地呼叫。May be safely called during enumeration of the children.

(繼承來源 ProjectElementContainer)
ShouldCloneXmlAttribute(XmlAttribute)

請勿複製可以是中繼資料的屬性。Do not clone attributes which can be metadata. 以屬性專案元素表示的對應會負責加入其屬性The corresponding expressed as attribute project elements are responsible for adding their attribute

ShouldCloneXmlAttribute(XmlAttribute)

子類別的勾點,用於指定給定的Hook for subclasses to specify whether the given 是否應該加以複製should be cloned or not

(繼承來源 ProjectElement)
ToString()

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

(繼承來源 Object)

適用於