MessageProperties MessageProperties MessageProperties MessageProperties Class

定義

表示訊息屬性集。Represents a set of properties for a message. 這個類別無法被繼承。This class cannot be inherited.

public ref class MessageProperties sealed : IDisposable, System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>, System::Collections::Generic::IDictionary<System::String ^, System::Object ^>, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>
public sealed class MessageProperties : IDisposable, System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,object>>, System.Collections.Generic.IDictionary<string,object>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object>>
type MessageProperties = class
    interface IDictionary<string, obj>
    interface ICollection<KeyValuePair<string, obj>>
    interface seq<KeyValuePair<string, obj>>
    interface IEnumerable
    interface IDisposable
Public NotInheritable Class MessageProperties
Implements ICollection(Of KeyValuePair(Of String, Object)), IDictionary(Of String, Object), IDisposable, IEnumerable(Of KeyValuePair(Of String, Object))
繼承
MessagePropertiesMessagePropertiesMessagePropertiesMessageProperties
實作

備註

在訊息通過通道基礎結構的同時,它也會通過許多邏輯上獨立的處理實體。As a message passes through the channel infrastructure, it passes through a number of logically separate processing entities. 例如,屬於可信賴傳訊資料流一部分的訊息可能會通過 MessageEncoder、傳輸層級的通道提供者、可信賴傳訊通道提供者、資料流通道提供者或任何通道延伸。For instance, a message that is part of a reliable messaging stream can potentially pass through a MessageEncoder, a transport-level channel provider, the reliable-messaging channel provider, the streaming channel provider or any channel extensions. 這些媒介有時候會使用 MessageProperties 類別以處理結果來標註訊息。Sometimes these intermediaries annotate the message with the results of that processing by using the MessageProperties class. MessageProperties 執行個體為訊息上的附註,並且會在 Properties 執行個體的 Message 屬性中儲存為一個名稱對應至物件的集合。A MessageProperties instance is an annotation on a message and is stored as a set of name-to-object mappings in the Properties property of a Message instance.

注意

訊息內容應該清除時使用者會收到下列錯誤:The message properties should be cleared out when the user gets the following error:

伺服器認可通訊協定違規。區段 = ResponseBody 詳細資料 = 回應區塊格式無效The server committed a protocol violation. Section=ResponseBody Detail=Response chunk format is invalid

建構函式

MessageProperties() MessageProperties() MessageProperties() MessageProperties()

初始化 MessageProperties 類別的新執行個體。Initializes a new instance of the MessageProperties class.

MessageProperties(MessageProperties) MessageProperties(MessageProperties) MessageProperties(MessageProperties) MessageProperties(MessageProperties)

使用預設屬性來初始化 MessageProperties 類別的新執行個體。Initializes a new instance of the MessageProperties class with preset properties.

屬性

AllowOutputBatching AllowOutputBatching AllowOutputBatching AllowOutputBatching

取得或設定值,這個值會指定是否要在將此訊息交付傳輸之前先儲存。Gets or sets a value that specifies whether to store this message before giving it to the transport.

Count Count Count Count

取得 MessageProperties 中的屬性總數。Gets the total number of properties in the MessageProperties.

Encoder Encoder Encoder Encoder

取得編碼器,這個編碼器可用來寫入訊息至資料流及讀取資料流中的訊息。Gets the encoder that is used to write messages to a stream and to read messages from a stream.

IsFixedSize IsFixedSize IsFixedSize IsFixedSize

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

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

取得值,這個值表示這個屬性集是否是唯讀的。Gets a value that indicates whether this set of properties is read-only.

Item[String] Item[String] Item[String] Item[String]

擷取具有指定名稱、識別碼或索引鍵值的屬性。Retrieves a property with the specified name, identifier, or key value.

Keys Keys Keys Keys

取得 ICollection 中包含索引鍵的 MessagePropertiesGets an ICollection that contains the keys in the MessageProperties.

Security Security Security Security

取得或設定訊息的安全性相關屬性。Gets or sets the security-related property of a message.

Values Values Values Values

取得包含 ICollection 中之值的 MessagePropertiesGets an ICollection that contains the values in the MessageProperties.

Via Via Via Via

取得或設定傳送訊息時使用的傳輸位址。Gets or sets the transport address that is used to send messages.

方法

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

將具有指定名稱和屬性的項目加入至 MessageProperties 集合。Adds an element with the specified name and property into the MessageProperties collection.

Clear() Clear() Clear() Clear()

MessageProperties 集合移除所有元素。Removes all elements from the MessageProperties collection.

ContainsKey(String) ContainsKey(String) ContainsKey(String) ContainsKey(String)

判斷 MessageProperties 是否包含特定名稱、索引鍵或識別項。Determines whether the MessageProperties contains a specific name, key, or identifier.

CopyProperties(MessageProperties) CopyProperties(MessageProperties) CopyProperties(MessageProperties) CopyProperties(MessageProperties)

將指定之 MessageProperties 的內容複製到這個執行個體。Copies the content of the specified MessageProperties to this instance.

Dispose() Dispose() Dispose() Dispose()

釋放 MessageProperties 類別所使用的所有資源。Releases all resources used by the MessageProperties class.

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

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

(Inherited from Object)
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 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(String) Remove(String) Remove(String) Remove(String)

MessageProperties 中移除具有指定之名稱的項目。Removes the element with the specified name from the MessageProperties.

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

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

(Inherited from Object)
TryGetValue(String, Object) TryGetValue(String, Object) TryGetValue(String, Object) TryGetValue(String, Object)

判斷 MessageProperties 是否包含特定名稱,並且擷取其值。Determines whether the MessageProperties contains a specific name, and retrieves its value.

明確介面實作

ICollection<KeyValuePair<String,Object>>.Add(KeyValuePair<String,Object>) ICollection<KeyValuePair<String,Object>>.Add(KeyValuePair<String,Object>) ICollection<KeyValuePair<String,Object>>.Add(KeyValuePair<String,Object>) ICollection<KeyValuePair<String,Object>>.Add(KeyValuePair<String,Object>)

將有指定名稱和屬性的項目加入 MessagePropertiesAdds an element with the specified name and property into the MessageProperties.

ICollection<KeyValuePair<String,Object>>.Contains(KeyValuePair<String,Object>) ICollection<KeyValuePair<String,Object>>.Contains(KeyValuePair<String,Object>) ICollection<KeyValuePair<String,Object>>.Contains(KeyValuePair<String,Object>) ICollection<KeyValuePair<String,Object>>.Contains(KeyValuePair<String,Object>)

判斷 MessageProperties 是否包含特定名稱。Determines whether the MessageProperties contains a specific name.

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

從指定索引處開始,複製指定之 MessageProperties 的內容至陣列。Copies the content of the specified MessageProperties to an array, starting at the specified index.

ICollection<KeyValuePair<String,Object>>.IsReadOnly ICollection<KeyValuePair<String,Object>>.IsReadOnly ICollection<KeyValuePair<String,Object>>.IsReadOnly ICollection<KeyValuePair<String,Object>>.IsReadOnly
ICollection<KeyValuePair<String,Object>>.Remove(KeyValuePair<String,Object>) ICollection<KeyValuePair<String,Object>>.Remove(KeyValuePair<String,Object>) ICollection<KeyValuePair<String,Object>>.Remove(KeyValuePair<String,Object>) ICollection<KeyValuePair<String,Object>>.Remove(KeyValuePair<String,Object>)

MessageProperties 中移除具有指定之名稱的項目。Removes the element with the specified name from the MessageProperties.

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

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

IEnumerable<KeyValuePair<String,Object>>.GetEnumerator() IEnumerable<KeyValuePair<String,Object>>.GetEnumerator() IEnumerable<KeyValuePair<String,Object>>.GetEnumerator() IEnumerable<KeyValuePair<String,Object>>.GetEnumerator()

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

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.

適用於