MessageProperties MessageProperties MessageProperties MessageProperties Class

Definition

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))
Inheritance
MessagePropertiesMessagePropertiesMessagePropertiesMessageProperties
Implements

Remarks

As a message passes through the channel infrastructure, it passes through a number of logically separate processing entities. 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. Sometimes these intermediaries annotate the message with the results of that processing by using the MessageProperties class. 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.

Note

The message properties should be cleared out when the user gets the following error:

The server committed a protocol violation. Section=ResponseBody Detail=Response chunk format is invalid

Constructors

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

Initializes a new instance of the MessageProperties class.

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

Initializes a new instance of the MessageProperties class with preset properties.

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

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

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

Gets 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

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

Methods

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

Adds an element with the specified name and property into the MessageProperties collection.

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

Removes all elements from the MessageProperties collection.

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

Determines whether the MessageProperties contains a specific name, key, or identifier.

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

Copies the content of the specified MessageProperties to this instance.

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

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

Gets the Type of the current instance.

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

Creates a shallow copy of the current Object.

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

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)

Determines whether the MessageProperties contains a specific name, and retrieves its value.

Explicit Interface Implementations

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>)

Adds 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>)

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)

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>)

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>)

Returns 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)

Copies 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)

Copies 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)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(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)

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

Applies to