InlineCollection InlineCollection InlineCollection InlineCollection Class

定義

表示 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,這類TextBlockParagraphInlineCollection 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 Count Count Count

取得目前在此集合中的項目數。Gets the number of items currently in the collection.

(Inherited from TextElementCollection<TextElementType>)
FirstInline FirstInline FirstInline FirstInline

取得這個 Inline 執行個體內的第一個 InlineCollection 項目。Gets the first Inline element within this instance of InlineCollection.

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

取得 ICollection 中所包含的項目數。Gets the number of elements contained in the ICollection. 請改用型別安全的 Count 屬性。Use the type-safe Count property instead.

(Inherited from TextElementCollection<TextElementType>)
ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

取得值,這個值表示對 ICollection 的存取是否同步 (安全執行緒)。Gets a value indicating whether access to the ICollection is synchronized (thread safe).

(Inherited from TextElementCollection<TextElementType>)
ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

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

(Inherited from TextElementCollection<TextElementType>)
IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

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

(Inherited from TextElementCollection<TextElementType>)
IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly

取得值,指出 IList 是否唯讀。Gets a value indicating whether the IList is read-only.

(Inherited from TextElementCollection<TextElementType>)
IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

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

(Inherited from TextElementCollection<TextElementType>)
IsReadOnly IsReadOnly IsReadOnly IsReadOnly

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

(Inherited from TextElementCollection<TextElementType>)
LastInline LastInline LastInline LastInline

取得這個 Inline 執行個體內的最後一個 InlineCollection 項目。Gets the last Inline element within this instance of InlineCollection.

方法

Add(String) Add(String) Add(String) Add(String)

加入隱含的 Run 以及當做 String 提供的指定文字。Adds an implicit Run element with the given text, supplied as a String.

Add(TextElementType) Add(TextElementType) Add(TextElementType) Add(TextElementType)

將指定的項目附加至集合。Appends a specified item to the collection.

(Inherited from TextElementCollection<TextElementType>)
Add(UIElement) Add(UIElement) Add(UIElement) Add(UIElement)

加入隱含 InlineUIContainer 以及已在其中提供的 UIElementAdds an implicit InlineUIContainer with the supplied UIElement already in it.

AddRange(IEnumerable) AddRange(IEnumerable) AddRange(IEnumerable) AddRange(IEnumerable)

將指定的項目範圍附加到集合。Appends a specified range of items to the collection.

(Inherited from TextElementCollection<TextElementType>)
Clear() Clear() Clear() Clear()

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

(Inherited from TextElementCollection<TextElementType>)
Contains(TextElementType) Contains(TextElementType) Contains(TextElementType) Contains(TextElementType)

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

(Inherited from TextElementCollection<TextElementType>)
CopyTo(TextElementType[], Int32) CopyTo(TextElementType[], Int32) CopyTo(TextElementType[], Int32) 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.

(Inherited from TextElementCollection<TextElementType>)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回集合的內容列舉值。Returns an enumerator for the contents of the collection.

(Inherited from TextElementCollection<TextElementType>)
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)
InsertAfter(TextElementType, TextElementType) InsertAfter(TextElementType, TextElementType) InsertAfter(TextElementType, TextElementType) InsertAfter(TextElementType, TextElementType)

在集合的指定集合項目後面插入指定的項目。Inserts a specified item in the collection after a specified collection item.

(Inherited from TextElementCollection<TextElementType>)
InsertBefore(TextElementType, TextElementType) InsertBefore(TextElementType, TextElementType) InsertBefore(TextElementType, TextElementType) InsertBefore(TextElementType, TextElementType)

在集合的指定集合項目前面插入指定的項目。Inserts a specified item in the collection before a specified collection item.

(Inherited from TextElementCollection<TextElementType>)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
Remove(TextElementType) Remove(TextElementType) Remove(TextElementType) Remove(TextElementType)

從集合中移除指定的項目。Removes a specified item from the collection.

(Inherited from TextElementCollection<TextElementType>)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)

明確介面實作

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

從特定的 ICollection 索引開始,將 Array 的項目複製至 ArrayCopies 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.

(Inherited from TextElementCollection<TextElementType>)
IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

傳回逐一查看集合的列舉值。Returns an enumerator that iterates through a collection. 請改用類型安全的 GetEnumerator() 方法。Use the type-safe GetEnumerator() method instead.

(Inherited from TextElementCollection<TextElementType>)
IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

將項目加入至 IListAdds an item to the IList. 請改用類型安全的 Add(TextElementType) 方法。Use the type-safe Add(TextElementType) method instead.

(Inherited from TextElementCollection<TextElementType>)
IList.Clear() IList.Clear() IList.Clear() 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.

(Inherited from TextElementCollection<TextElementType>)
IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

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

(Inherited from TextElementCollection<TextElementType>)
IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

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

(Inherited from TextElementCollection<TextElementType>)
IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

將項目插入位於指定索引的 IListInserts 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.

(Inherited from TextElementCollection<TextElementType>)
IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) 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.

(Inherited from TextElementCollection<TextElementType>)
IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32)

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

(Inherited from TextElementCollection<TextElementType>)

Extension Methods

CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>)

傳回DataTable,其中包含副本DataRow物件,指定輸入IEnumerable<T>物件其中泛型參數TDataRowReturns 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)

複本DataRow至指定的物件DataTable,根據輸入IEnumerable<T>物件其中泛型參數TDataRowCopies 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)

複本DataRow至指定的物件DataTable,根據輸入IEnumerable<T>物件其中泛型參數TDataRowCopies 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)

將轉換IEnumerableIQueryableConverts 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.

適用於

另請參閱