ModelItemDictionary ModelItemDictionary ModelItemDictionary ModelItemDictionary Class

定义

派生自 ModelItem,并实现对键/值对字典的支持。Derives from ModelItem and implements support for a dictionary of key/value pairs.

public ref class ModelItemDictionary abstract : System::Activities::Presentation::Model::ModelItem, System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<System::Activities::Presentation::Model::ModelItem ^, System::Activities::Presentation::Model::ModelItem ^>>, System::Collections::Generic::IDictionary<System::Activities::Presentation::Model::ModelItem ^, System::Activities::Presentation::Model::ModelItem ^>, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::Activities::Presentation::Model::ModelItem ^, System::Activities::Presentation::Model::ModelItem ^>>, System::Collections::IDictionary, System::Collections::Specialized::INotifyCollectionChanged
public abstract class ModelItemDictionary : System.Activities.Presentation.Model.ModelItem, System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.Activities.Presentation.Model.ModelItem,System.Activities.Presentation.Model.ModelItem>>, System.Collections.Generic.IDictionary<System.Activities.Presentation.Model.ModelItem,System.Activities.Presentation.Model.ModelItem>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Activities.Presentation.Model.ModelItem,System.Activities.Presentation.Model.ModelItem>>, System.Collections.IDictionary, System.Collections.Specialized.INotifyCollectionChanged
type ModelItemDictionary = class
    inherit ModelItem
    interface IDictionary<ModelItem, ModelItem>
    interface ICollection<KeyValuePair<ModelItem, ModelItem>>
    interface seq<KeyValuePair<ModelItem, ModelItem>>
    interface IEnumerable
    interface IDictionary
    interface ICollection
    interface INotifyCollectionChanged
Public MustInherit Class ModelItemDictionary
Inherits ModelItem
Implements ICollection(Of KeyValuePair(Of ModelItem, ModelItem)), IDictionary, IDictionary(Of ModelItem, ModelItem), IEnumerable(Of KeyValuePair(Of ModelItem, ModelItem)), INotifyCollectionChanged
继承
ModelItemDictionaryModelItemDictionaryModelItemDictionaryModelItemDictionary
实现

构造函数

ModelItemDictionary() ModelItemDictionary() ModelItemDictionary() ModelItemDictionary()

创建一个新的 ModelItemDictionaryCreates a new ModelItemDictionary.

字段

KeyProperty KeyProperty KeyProperty KeyProperty

DependencyProperty,它表示添加到字典中所有项的键/值对中的键。The DependencyProperty that represents the key in the key/value pair that is added to all items in the dictionary. KeyProperty 的日期类型为 ModelItemThe data type of the KeyProperty is ModelItem.

属性

Attributes Attributes Attributes Attributes

获取在此项上声明的特性。Gets the attributes declared on this item.

(Inherited from ModelItem)
Content Content Content Content

获取项的 ContentPropertyAttributenullGets the ContentPropertyAttribute of the item, or null.

(Inherited from ModelItem)
Count Count Count Count

返回字典中项的计数。Returns the count of items in the dictionary.

IsFixedSize IsFixedSize IsFixedSize IsFixedSize

确定字典是否为固定大小。Determines whether the dictionary is a fixed size.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

确定是否无法修改字典。Determines whether the dictionary cannot be modified.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

获取一个值,该值指示对字典的访问是否同步(线程安全)。Gets a value that indicates whether access to the dictionary is synchronized (thread safe).

ItemType ItemType ItemType ItemType

获取返回项所表示的对象的类型。Gets the type of object that the item represents.

(Inherited from ModelItem)
Item[ModelItem] Item[ModelItem] Item[ModelItem] Item[ModelItem]

获取或设置指定键处的项。Gets or sets the item at the specified key.

Item[Object] Item[Object] Item[Object] Item[Object]

获取或设置指定键处的项。Gets or sets the item at the specified key.

Keys Keys Keys Keys

获取集合的键。Gets the keys of the collection. 要保证键具有与值一样的顺序。The keys are guaranteed to be in the same order as the values. 生成的集合是只读的。The resulting collection is read-only.

Name Name Name Name

获取或设置项的名称或 ID 。Gets or sets the name or ID of the item.

(Inherited from ModelItem)
Parent Parent Parent Parent

获取返回作为此项的父级的项。Gets the item that is the parent of this item.

(Inherited from ModelItem)
Parents Parents Parents Parents

获取此项的所有父级。Gets all parents of this item.

(Inherited from ModelItem)
Properties Properties Properties Properties

设置此项上的公共属性。Gets the public properties on this item.

(Inherited from ModelItem)
Root Root Root Root

获取返回作为此树的根的项。Gets the item that is the root of this tree.

(Inherited from ModelItem)
Source Source Source Source

获取提供此值的属性。Gets the property that provided this value.

(Inherited from ModelItem)
Sources Sources Sources Sources

获取保存此值的所有属性。Gets all the properties that hold this value.

(Inherited from ModelItem)
SyncRoot SyncRoot SyncRoot SyncRoot

获取可用于同步对此集合的访问的对象。Gets an object that can be used to synchronize access to this collection.

Values Values Values Values

获取集合的值。Gets the values of the collection.

View View View View

获取以图形方式表示此项的 DependencyObjectGets a DependencyObject that graphically represents this item.

(Inherited from ModelItem)

方法

Add(ModelItem, ModelItem) Add(ModelItem, ModelItem) Add(ModelItem, ModelItem) Add(ModelItem, ModelItem)

采用给定的键将值添加到字典。Adds the value to the dictionary under the given key.

Add(Object, Object) Add(Object, Object) Add(Object, Object) Add(Object, Object)

采用给定的键将值添加到字典。Adds the value to the dictionary under the given key. 此方法将键和值包装在一组 ModelItem 对象中。This method wraps the key and value in a set of ModelItem objects.

BeginEdit() BeginEdit() BeginEdit() 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.

(Inherited from ModelItem)
BeginEdit(Boolean) BeginEdit(Boolean) BeginEdit(Boolean) BeginEdit(Boolean)

打开设计器的编辑范围。Opens an editing scope for the designer.

(Inherited from ModelItem)
BeginEdit(String) BeginEdit(String) BeginEdit(String) 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.

(Inherited from ModelItem)
BeginEdit(String, Boolean) BeginEdit(String, Boolean) BeginEdit(String, Boolean) BeginEdit(String, Boolean)

打开设计器的编辑范围。Opens an editing scope for the designer.

(Inherited from ModelItem)
Clear() Clear() Clear() Clear()

清除字典的内容。Clears the contents of the dictionary.

Contains(KeyValuePair<ModelItem,ModelItem>) Contains(KeyValuePair<ModelItem,ModelItem>) Contains(KeyValuePair<ModelItem,ModelItem>) Contains(KeyValuePair<ModelItem,ModelItem>)

确定字典是否包含给定的键/值对。Determines whether the dictionary contains the given key/value pair.

ContainsKey(ModelItem) ContainsKey(ModelItem) ContainsKey(ModelItem) ContainsKey(ModelItem)

确定字典是否包含给定的键。Determines whether the dictionary contains the given key.

ContainsKey(Object) ContainsKey(Object) ContainsKey(Object) ContainsKey(Object)

确定字典是否包含给定的键。Determines whether the dictionary contains the given key.

CopyTo(KeyValuePair<ModelItem,ModelItem>[], Int32) CopyTo(KeyValuePair<ModelItem,ModelItem>[], Int32) CopyTo(KeyValuePair<ModelItem,ModelItem>[], Int32) CopyTo(KeyValuePair<ModelItem,ModelItem>[], Int32)

将键/值对的数组复制到给定字典中。Copies an array of key/value pairs into the given dictionary.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetCurrentValue() GetCurrentValue() GetCurrentValue() GetCurrentValue()

返回 ModelItem 所包装的基础模型对象的当前值。Returns the current value of the underlying model object that the ModelItem is wrapping.

(Inherited from ModelItem)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

返回字典中项的枚举器。Returns an enumerator for the items in the dictionary.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
Remove(ModelItem) Remove(ModelItem) Remove(ModelItem) Remove(ModelItem)

从字典中移除具有指定键的项。Removes the item with the specified key from the dictionary.

Remove(Object) Remove(Object) Remove(Object) Remove(Object)

从字典中移除项。Removes the item from the dictionary.

ToString() ToString() ToString() ToString()

返回此模型项中包含的基础模型对象的字符串表示形式。Returns a string representation of the underlying model object contained in this model item.

(Inherited from ModelItem)
TryGetValue(ModelItem, ModelItem) TryGetValue(ModelItem, ModelItem) TryGetValue(ModelItem, ModelItem) TryGetValue(ModelItem, ModelItem)

检索给定键的值(如果可能)。Retrieves the value for the given key, if possible.

TryGetValue(Object, ModelItem) TryGetValue(Object, ModelItem) TryGetValue(Object, ModelItem) TryGetValue(Object, ModelItem)

检索给定键的值(如果可能)。Retrieves the value for the given key, if possible.

事件

CollectionChanged CollectionChanged CollectionChanged CollectionChanged

在此集合的内容发生更改时引发。Raised when the contents of this collection change.

PropertyChanged PropertyChanged PropertyChanged 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.

(Inherited from ModelItem)

显式界面实现

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

ICollection 的元素复制到一个数组中从特定的数组索引开始的位置。Copies the elements of the ICollection to an array, starting at a particular array index.

ICollection.Count ICollection.Count ICollection.Count ICollection.Count

获取 ICollection 中包含的元素数。Gets the number of elements contained in the ICollection.

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

获取一个值,该值指示对 ICollection 的访问是否同步(线程安全)。Gets a value that indicates whether access to the ICollection is synchronized (thread safe).

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

获取可用于同步对 ICollection的访问的对象。Gets an object that can be used to synchronize access to the ICollection.

ICollection<KeyValuePair<ModelItem,ModelItem>>.Add(KeyValuePair<ModelItem,ModelItem>) ICollection<KeyValuePair<ModelItem,ModelItem>>.Add(KeyValuePair<ModelItem,ModelItem>) ICollection<KeyValuePair<ModelItem,ModelItem>>.Add(KeyValuePair<ModelItem,ModelItem>) ICollection<KeyValuePair<ModelItem,ModelItem>>.Add(KeyValuePair<ModelItem,ModelItem>)

在集合末尾添加一个新元素。Adds a new element to the end of the collection.

ICollection<KeyValuePair<ModelItem,ModelItem>>.Contains(KeyValuePair<ModelItem,ModelItem>) ICollection<KeyValuePair<ModelItem,ModelItem>>.Contains(KeyValuePair<ModelItem,ModelItem>) ICollection<KeyValuePair<ModelItem,ModelItem>>.Contains(KeyValuePair<ModelItem,ModelItem>) ICollection<KeyValuePair<ModelItem,ModelItem>>.Contains(KeyValuePair<ModelItem,ModelItem>)

确定字典是否包含给定的键/值对。Determines whether the dictionary contains the given key/value pair.

ICollection<KeyValuePair<ModelItem,ModelItem>>.CopyTo(KeyValuePair<ModelItem,ModelItem>[], Int32) ICollection<KeyValuePair<ModelItem,ModelItem>>.CopyTo(KeyValuePair<ModelItem,ModelItem>[], Int32) ICollection<KeyValuePair<ModelItem,ModelItem>>.CopyTo(KeyValuePair<ModelItem,ModelItem>[], Int32) ICollection<KeyValuePair<ModelItem,ModelItem>>.CopyTo(KeyValuePair<ModelItem,ModelItem>[], Int32)

将键/值对的数组复制到给定字典中。Copies an array of key/value pairs into the given dictionary.

ICollection<KeyValuePair<ModelItem,ModelItem>>.Remove(KeyValuePair<ModelItem,ModelItem>) ICollection<KeyValuePair<ModelItem,ModelItem>>.Remove(KeyValuePair<ModelItem,ModelItem>) ICollection<KeyValuePair<ModelItem,ModelItem>>.Remove(KeyValuePair<ModelItem,ModelItem>) ICollection<KeyValuePair<ModelItem,ModelItem>>.Remove(KeyValuePair<ModelItem,ModelItem>)

从字典中移除指定的键/值对。Removes the specified key/value pair from the dictionary.

IDictionary.Add(Object, Object) IDictionary.Add(Object, Object) IDictionary.Add(Object, Object) IDictionary.Add(Object, Object)

IDictionary 对象中添加一个带有所提供的键和值的元素。Adds an element with the provided key and value to the IDictionary object.

IDictionary.Clear() IDictionary.Clear() IDictionary.Clear() IDictionary.Clear()

IDictionary 对象中移除所有元素。Removes all elements from the IDictionary object.

IDictionary.Contains(Object) IDictionary.Contains(Object) IDictionary.Contains(Object) IDictionary.Contains(Object)

确定 IDictionary 对象是否包含具有指定键的元素。Determines whether the IDictionary object contains an element with the specified key.

IDictionary.GetEnumerator() IDictionary.GetEnumerator() IDictionary.GetEnumerator() IDictionary.GetEnumerator()

返回 IDictionaryEnumerator 对象的 IDictionary 对象。Returns the IDictionaryEnumerator object for the IDictionary object.

IDictionary.IsFixedSize IDictionary.IsFixedSize IDictionary.IsFixedSize IDictionary.IsFixedSize

获取一个值,该值指示 IDictionary 对象是否具有固定大小。Gets a value that indicates whether the IDictionary object has a fixed size.

IDictionary.IsReadOnly IDictionary.IsReadOnly IDictionary.IsReadOnly IDictionary.IsReadOnly

获取一个值,该值指示 IDictionary 对象是否为只读。Gets a value that indicates whether the IDictionary object is read-only.

IDictionary.Item[Object] IDictionary.Item[Object] IDictionary.Item[Object] IDictionary.Item[Object]

获取或设置具有指定键的元素。Gets or sets the element with the specified key.

IDictionary.Keys IDictionary.Keys IDictionary.Keys IDictionary.Keys

获取一个 ICollection 对象,其中包含 IDictionary 对象的键。Gets an ICollection object that contains the keys of the IDictionary object.

IDictionary.Remove(Object) IDictionary.Remove(Object) IDictionary.Remove(Object) IDictionary.Remove(Object)

IDictionary 中移除包含指定键的元素。Removes the element with the specified key from the IDictionary.

IDictionary.Values IDictionary.Values IDictionary.Values IDictionary.Values

获取一个 ICollection 对象,其中包含 IDictionary 对象的值。Gets an ICollection object that contains the values in the IDictionary object.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

返回循环访问集合的枚举数。Returns an enumerator that iterates through a collection.

扩展方法

Focus(ModelItem) Focus(ModelItem) Focus(ModelItem) Focus(ModelItem)

将键盘焦点置于指定的设计器项上。Sets the keyboard focus on the specified designer item.

Focus(ModelItem, Int32) Focus(ModelItem, Int32) Focus(ModelItem, Int32) Focus(ModelItem, Int32)

将键盘焦点置于指定的设计器项上。Sets the keyboard focus on the specified designer item.

GetEditingContext(ModelItem) GetEditingContext(ModelItem) GetEditingContext(ModelItem) GetEditingContext(ModelItem)

检索指定模型项的编辑上下文。Retrieves the editing context of the specified model item.

GetModelPath(ModelItem) GetModelPath(ModelItem) GetModelPath(ModelItem) GetModelPath(ModelItem)

检索指定模型项的路径。Retrieves the path of the specified model item.

IsParentOf(ModelItem, ModelItem) IsParentOf(ModelItem, ModelItem) IsParentOf(ModelItem, ModelItem) 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>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) 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) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) 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) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) 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) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的元素强制转换为指定的类型。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根据指定类型筛选 IEnumerable 的元素。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

启用查询的并行化。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 转换为 IQueryableConverts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) 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) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) 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>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子代节点的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) 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) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) 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>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) 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) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) 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>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) 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>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>)

返回源集合中每个文档和元素的子节点集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>)

将源集合中的每个节点从其父节点中移除。Removes every node in the source collection from its parent node.

适用于