ModelItemCollection 類別

定義

代表可依索引個別存取的模型項目集合。Represents a collection of model items that can be individually accessed by index.

public ref class ModelItemCollection abstract : System::Activities::Presentation::Model::ModelItem, System::Collections::Generic::ICollection<System::Activities::Presentation::Model::ModelItem ^>, System::Collections::Generic::IEnumerable<System::Activities::Presentation::Model::ModelItem ^>, System::Collections::Generic::IList<System::Activities::Presentation::Model::ModelItem ^>, System::Collections::IList, System::Collections::Specialized::INotifyCollectionChanged
public abstract class ModelItemCollection : System.Activities.Presentation.Model.ModelItem, System.Collections.Generic.ICollection<System.Activities.Presentation.Model.ModelItem>, System.Collections.Generic.IEnumerable<System.Activities.Presentation.Model.ModelItem>, System.Collections.Generic.IList<System.Activities.Presentation.Model.ModelItem>, System.Collections.IList, System.Collections.Specialized.INotifyCollectionChanged
type ModelItemCollection = class
    inherit ModelItem
    interface IList<ModelItem>
    interface ICollection<ModelItem>
    interface seq<ModelItem>
    interface IEnumerable
    interface IList
    interface ICollection
    interface INotifyCollectionChanged
Public MustInherit Class ModelItemCollection
Inherits ModelItem
Implements ICollection(Of ModelItem), IEnumerable(Of ModelItem), IList, IList(Of ModelItem), INotifyCollectionChanged
繼承
ModelItemCollection
實作

備註

如果在編輯範圍期間對專案集合進行變更(例如,在拖放作業中) Count ,屬性必須等到編輯範圍完成後才會更新。If changes are made to the item collection during an editing scope, such as within a drag and drop operation, the Count property will not be updated until the editing scope completes.

建構函式

ModelItemCollection()

建立 ModelItemCollection 的新執行個體。Creates a new instance of ModelItemCollection.

欄位

ItemProperty

識別 Item 相依性屬性。Identifies the Item dependency property.

屬性

Attributes

取得在這個項目上宣告的屬性。Gets the attributes declared on this item.

(繼承來源 ModelItem)
Content

取得項目的 ContentPropertyAttribute,或 nullGets the ContentPropertyAttribute of the item, or null.

(繼承來源 ModelItem)
Count

傳回集合中的項目計數。Returns the count of items in the collection.

IsFixedSize

取得值,這個值會表示集合是否具有固定大小。Gets a value that indicates whether the collection has a fixed size.

IsReadOnly

取得值,這個值表示集合是否為唯讀。Gets a value that indicates whether the collection is read-only.

IsSynchronized

取得值,這個值會指出是否同步處理對集合的存取 (具備執行緒安全)。Gets a value that indicates whether access to the collection is synchronized (thread safe).

Item[Int32]

在集合中的指定索引處取得或設定項目。Gets or sets the item at the given index in the collection.

ItemType

取得項目表示的物件型別。Gets the type of object that the item represents.

(繼承來源 ModelItem)
Name

取得或設定項目的名稱或 ID。Gets or sets the name or ID of the item.

(繼承來源 ModelItem)
Parent

取得項目,該項目是這個項目的父項。Gets the item that is the parent of this item.

(繼承來源 ModelItem)
Parents

取得這個項目的所有父項。Gets all parents of this item.

(繼承來源 ModelItem)
Properties

取得這個項目的公用屬性。Gets the public properties on this item.

(繼承來源 ModelItem)
Root

取得項目,該項目是這個樹狀架構的根。Gets the item that is the root of this tree.

(繼承來源 ModelItem)
Source

取得提供這個值的屬性。Gets the property that provided this value.

(繼承來源 ModelItem)
Sources

取得保存這個值的所有屬性。Gets all the properties that hold this value.

(繼承來源 ModelItem)
SyncRoot

取得物件,這個物件可以用來對集合進行同步存取。Gets an object that can be used to synchronize access to the collection.

View

取得以圖形表示這個項目的 DependencyObjectGets a DependencyObject that graphically represents this item.

(繼承來源 ModelItem)

方法

Add(ModelItem)

將模型項目加入至 ModelItemCollection 結尾。Adds a model item to the end of the ModelItemCollection.

Add(Object)

將模型項目加入至 ModelItemCollection 結尾。Adds a model item to the end of the ModelItemCollection.

BeginEdit()

開啟設計工具的編輯範圍。Opens an editing scope for the designer. 開啟編輯範圍後,會將所有物件的變更儲存在範圍中,直到交易完成或還原為止。After an editing scope is open, all changes across all objects will be saved into the scope until the transaction is completed or reverted. 編輯範圍可以是巢狀,但必須依序認可。Editing scopes can be nested, but must be committed in order.

(繼承來源 ModelItem)
BeginEdit(Boolean)

開啟設計工具的編輯範圍。Opens an editing scope for the designer.

(繼承來源 ModelItem)
BeginEdit(String)

開啟設計工具的編輯範圍。Opens an editing scope for the designer. 開啟編輯範圍後,會將所有物件的變更儲存在範圍中,直到交易完成或還原為止。After an editing scope is open, all changes across all objects will be saved into the scope until the transaction is completed or reverted. 編輯範圍可以是巢狀,但必須依序認可。Editing scopes can be nested, but must be committed in order.

(繼承來源 ModelItem)
BeginEdit(String, Boolean)

開啟設計工具的編輯範圍。Opens an editing scope for the designer.

(繼承來源 ModelItem)
Clear()

移除 ModelItemCollection 中的所有項目。Removes all elements from the ModelItemCollection.

Contains(ModelItem)

判斷 ModelItemCollection 是否包含指定的項目。Determines whether the ModelItemCollection contains the specified element.

Contains(Object)

判斷 ModelItemCollection 是否包含指定的項目。Determines whether the ModelItemCollection contains the specified element.

CopyTo(ModelItem[], Int32)

將集合的內容複製至指定的陣列中。Copies the contents of the collection into the given array.

Equals(Object)

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

(繼承來源 Object)
GetCurrentValue()

傳回 ModelItem 所包裝之基礎模型物件的目前值。Returns the current value of the underlying model object that the ModelItem is wrapping.

(繼承來源 ModelItem)
GetEnumerator()

取得可逐一查看 ModelItemCollection 的列舉值。Gets an enumerator that iterates through the ModelItemCollection.

GetHashCode()

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

(繼承來源 Object)
GetType()

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

(繼承來源 Object)
IndexOf(ModelItem)

傳回以零起始的索引,對象為 ModelItemCollection 中第一次出現的值。Returns the zero-based index of the first occurrence of a value in the ModelItemCollection.

Insert(Int32, ModelItem)

將項目插入至 ModelItemCollection 中指定的索引位置。Inserts an element into the ModelItemCollection at the specified index.

Insert(Int32, Object)

將項目插入至 ModelItemCollection 中指定的索引位置。Inserts an element into the ModelItemCollection at the specified index.

MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
Move(Int32, Int32)

將集合中的項目移至不同的索引。Moves an item in the collection to a different index.

Remove(ModelItem)

從集合中移除 ModelItemRemoves the ModelItem from the collection.

Remove(Object)

移除集合中的值。Removes the value from the collection.

RemoveAt(Int32)

移除在指定索引處的項目。Removes the item at the given index.

ToString()

傳回包含在這個模型項目中之基礎模型物件的字串表示。Returns a string representation of the underlying model object contained in this model item.

(繼承來源 ModelItem)

事件

CollectionChanged

發生於集合變更時。Occurs when the collection changes.

PropertyChanged

實作 INotifyPropertyChangedImplements INotifyPropertyChanged. 使用這個事件接聽模型的變更。Use this event to listen for changes to the model. WPF 的資料繫結功能也會使用這個方法。This is also used by the data binding features of WPF.

(繼承來源 ModelItem)

明確介面實作

ICollection.CopyTo(Array, Int32)

從特定的 ICollection 索引開始,將 Array 的項目複製到 ArrayCopies the elements of the ICollection to an Array, starting at a particular Array index.

ICollection.Count

取得集合所包含的項目數目。Gets the number of elements contained in the collection.

ICollection.IsSynchronized

ICollection 中包含的項目數目會同步處理 (具備執行緒安全)。The number of elements contained in the ICollection is synchronized (thread safe).

ICollection.SyncRoot

取得可用以同步存取 ICollection的物件。Gets an object that can be used to synchronize access to the ICollection.

IEnumerable.GetEnumerator()

傳回逐一查看集合的列舉值。Returns an enumerator that iterates through a collection.

IList.Add(Object)

將模型項目加入至 ModelItemCollection 結尾。Adds a model item to the end of the ModelItemCollection.

IList.Clear()

IList 中移除所有項目。Removes all items from the IList.

IList.Contains(Object)

判斷 ModelItemCollection 是否包含指定的項目。Determines whether the ModelItemCollection contains the specified element.

IList.IndexOf(Object)

判斷 IList 中指定項目的索引。Determines the index of a specific item in the IList.

IList.Insert(Int32, Object)

將項目插入至 ModelItemCollection 中指定的索引位置。Inserts an element into the ModelItemCollection at the specified index.

IList.IsFixedSize

取得值,指出 IList 是否有固定的大小。Gets a value that indicates whether the IList has a fixed size.

IList.IsReadOnly

取得值,這個值表示 IList 是否為唯讀。Gets a value that indicates whether the IList is read-only.

IList.Item[Int32]

在指定的索引位置上取得或設定項目。Gets or sets the element at the specified index.

IList.Remove(Object)

IList 移除特定物件之第一個符合的元素。Removes the first occurrence of a specific object from the IList.

IList.RemoveAt(Int32)

移除在指定索引處的 IList 項目。Removes the IList item at the specified index.

擴充方法

Focus(ModelItem)

在指定的設計工具項目上設定鍵盤焦點。Sets the keyboard focus on the specified designer item.

Focus(ModelItem, Int32)

在指定的設計工具項目上設定鍵盤焦點。Sets the keyboard focus on the specified designer item.

GetEditingContext(ModelItem)

擷取指定模型項目的編輯內容。Retrieves the editing context of the specified model item.

GetModelPath(ModelItem)

擷取指定模型項目的路徑。Retrieves the path of the specified model item.

IsParentOf(ModelItem, ModelItem)

傳回值,這個值表示第一個指定設計工具項目是否為第二個指定設計工具項目的父代。Returns a value that indicates whether the first specified designer item is a parent of the second specified designer item.

CopyToDataTable<T>(IEnumerable<T>)

根據輸入 DataTable 物件 (其中泛型參數 TDataRow) 傳回包含 IEnumerable<T> 物件複本的 DataRowReturns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>)

傳回包含來源集合中每個節點祖系的項目集合。Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName)

傳回包含來源集合中每個節點祖系的已篩選項目集合。Returns a filtered collection of elements that contains the ancestors of every node in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目之子代節點的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>)

傳回包含來源集合中每個項目和文件之子代項目的項目集合。Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName)

傳回已篩選的項目集合,其中包含來源集合中每個項目和文件的子代項目。Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>)

傳回來源集合中每個項目和文件的子項目集合。Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName)

傳回來源集合中每個項目和文件的已篩選子項目集合。Returns a filtered collection of the child elements of every element and document in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>)

傳回包含來源集合中所有節點的節點集合,依據文件順序來排序。Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目的子節點集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>)

在來源集合中,從每一個節點的父節點移除這些節點。Removes every node in the source collection from its parent node.

適用於