InlineCollection 类

定义

表示 Inline 元素的集合。Represents a collection of Inline elements. InlineCollection 定义 ParagraphSpanTextBlock 元素允许的子内容。InlineCollection defines the allowable child content of the Paragraph, Span, and TextBlock elements.

public ref class InlineCollection : System::Windows::Documents::TextElementCollection<System::Windows::Documents::Inline ^>, System::Collections::IList
[System.Windows.Markup.ContentWrapper(typeof(System.Windows.Documents.Run))]
[System.Windows.Markup.ContentWrapper(typeof(System.Windows.Documents.InlineUIContainer))]
[System.Windows.Markup.WhitespaceSignificantCollection]
public class InlineCollection : System.Windows.Documents.TextElementCollection<System.Windows.Documents.Inline>, System.Collections.IList
type InlineCollection = class
    inherit TextElementCollection<Inline>
    interface IList
    interface ICollection
    interface IEnumerable
Public Class InlineCollection
Inherits TextElementCollection(Of Inline)
Implements IList
继承
属性
实现

注解

InlineCollection仅允许在拥有InlineCollection的元素 (如TextBlockParagraph) 中创建。InlineCollection creation is only permitted inside an element that owns an InlineCollection, such as a TextBlock or a Paragraph. 因此, InlineCollection不能直接实例化, 且没有默认或重载构造函数。As such, an InlineCollection cannot be instantiated directly and has no default or overloaded constructor.

属性

Count

获取当前集合中项的数目。Gets the number of items currently in the collection.

(继承自 TextElementCollection<TextElementType>)
FirstInline

获取此 Inline 实例中的第一个 InlineCollection 元素。Gets the first Inline element within this instance of InlineCollection.

IsReadOnly

获取一个值,该值指示该集合是否为只读。Gets a value that indicates whether or not the collection is read-only.

(继承自 TextElementCollection<TextElementType>)
LastInline

获取此 Inline 实例中的最后一个 InlineCollection 元素。Gets the last Inline element within this instance of InlineCollection.

方法

Add(String)

用作为 Run 提供的给定文本添加一个隐式 String 元素。Adds an implicit Run element with the given text, supplied as a String.

Add(TextElementType)

将指定的项追加到集合。Appends a specified item to the collection.

(继承自 TextElementCollection<TextElementType>)
Add(UIElement)

添加一个隐式 InlineUIContainer,提供的 UIElement 已经包含在其中。Adds an implicit InlineUIContainer with the supplied UIElement already in it.

AddRange(IEnumerable)

将指定范围内的项追加到集合中。Appends a specified range of items to the collection.

(继承自 TextElementCollection<TextElementType>)
Clear()

清除集合中的所有项。Clears all items from the collection.

(继承自 TextElementCollection<TextElementType>)
Contains(TextElementType)

查询集合中是否存在指定的项。Queries for the presence of a specified item in the collection.

(继承自 TextElementCollection<TextElementType>)
CopyTo(TextElementType[], Int32)

复制集合的内容并插入到指定数组中,从数组中指定的索引位置开始插入。Copies the contents of the collection and inserts them into a specified array starting at a specified index position in the array.

(继承自 TextElementCollection<TextElementType>)
Equals(Object)

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

(继承自 Object)
GetEnumerator()

返回集合内容的一个枚举数。Returns an enumerator for the contents of the collection.

(继承自 TextElementCollection<TextElementType>)
GetHashCode()

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

(继承自 Object)
GetType()

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

(继承自 Object)
InsertAfter(TextElementType, TextElementType)

将集合中的指定项插入到指定集合项之后。Inserts a specified item in the collection after a specified collection item.

(继承自 TextElementCollection<TextElementType>)
InsertBefore(TextElementType, TextElementType)

将集合中的指定项插入到指定集合项之前。Inserts a specified item in the collection before a specified collection item.

(继承自 TextElementCollection<TextElementType>)
MemberwiseClone()

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

(继承自 Object)
Remove(TextElementType)

从集合中移除指定的项。Removes a specified item from the collection.

(继承自 TextElementCollection<TextElementType>)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

显式界面实现

ICollection.CopyTo(Array, Int32)

从特定的 ICollection 索引开始,将 Array 的元素复制到一个 Array 中。Copies the elements of the ICollection to an Array, starting at a particular Array index. 改用类型安全的 CopyTo(TextElementType[], Int32) 方法。Use the type-safe CopyTo(TextElementType[], Int32) method instead.

(继承自 TextElementCollection<TextElementType>)
ICollection.Count

获取 ICollection 中包含的元素数。Gets the number of elements contained in the ICollection. 请改用类型安全的 Count 属性。Use the type-safe Count property instead.

(继承自 TextElementCollection<TextElementType>)
ICollection.IsSynchronized

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

(继承自 TextElementCollection<TextElementType>)
ICollection.SyncRoot

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

(继承自 TextElementCollection<TextElementType>)
IEnumerable.GetEnumerator()

返回循环访问集合的枚举数。Returns an enumerator that iterates through a collection. 改用类型安全的 GetEnumerator() 方法。Use the type-safe GetEnumerator() method instead.

(继承自 TextElementCollection<TextElementType>)
IList.Add(Object)

将某项添加到 IList 中。Adds an item to the IList. 改用类型安全的 Add(TextElementType) 方法。Use the type-safe Add(TextElementType) method instead.

(继承自 TextElementCollection<TextElementType>)
IList.Clear()

此类型或成员支持 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构,但不可直接在代码中使用。This type or member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. 改用类型安全的 Clear() 方法。Use the type-safe Clear() method instead.

(继承自 TextElementCollection<TextElementType>)
IList.Contains(Object)

确定 IList 是否包含特定值。Determines whether the IList contains a specific value. 改用类型安全的 Contains(TextElementType) 方法。Use the type-safe Contains(TextElementType) method instead.

(继承自 TextElementCollection<TextElementType>)
IList.IndexOf(Object)

确定 IList 中特定项的索引。Determines the index of a specific item in the IList.

(继承自 TextElementCollection<TextElementType>)
IList.Insert(Int32, Object)

IList 中的指定索引处插入一个项。Inserts an item to the IList at the specified index. 请改用类型安全的 InsertAfter(TextElementType, TextElementType)InsertBefore(TextElementType, TextElementType) 方法。Use the type-safe InsertAfter(TextElementType, TextElementType) or InsertBefore(TextElementType, TextElementType) methods instead.

(继承自 TextElementCollection<TextElementType>)
IList.IsFixedSize

获取一个值,该值指示 IList 是否具有固定大小。Gets a value indicating whether the IList has a fixed size.

(继承自 TextElementCollection<TextElementType>)
IList.IsReadOnly

获取一个值,该值指示 IList 是否为只读。Gets a value indicating whether the IList is read-only.

(继承自 TextElementCollection<TextElementType>)
IList.Item[Int32]

获取或设置指定索引处的元素。Gets or sets the element at the specified index.

(继承自 TextElementCollection<TextElementType>)
IList.Remove(Object)

IList 中移除特定对象的第一个匹配项。Removes the first occurrence of a specific object from the IList. 改用类型安全的 Remove(TextElementType) 方法。Use the type-safe Remove(TextElementType) method instead.

(继承自 TextElementCollection<TextElementType>)
IList.RemoveAt(Int32)

移除位于指定索引处的 IList 项。Removes the IList item at the specified index.

(继承自 TextElementCollection<TextElementType>)

扩展方法

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.

适用于

另请参阅