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

获取项的 ContentPropertyAttributenullGets 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 的浅表副本。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 的元素复制到一个 Array 中。Copies 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>)

在给定其泛型参数 TDataTable 的输入 DataRow 对象的情况下,返回包含 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)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 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)

在给定其泛型参数 TDataRow 的输入 DataTable 对象的情况下,将 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.

适用于