Table of Contents

Class MessageHeaders

Namespace
AnyProtocol
Assembly
AnyProtocol.dll

Provides case-insensitive access to message metadata headers.

public sealed class MessageHeaders : IMessageHeaders, IReadOnlyDictionary<string, string>, IReadOnlyCollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable
Inheritance
MessageHeaders
Implements
Inherited Members

Constructors

MessageHeaders()

Initializes a new instance of the MessageHeaders class.

public MessageHeaders()

MessageHeaders(IEnumerable<KeyValuePair<string, string>>)

Initializes a new instance of the MessageHeaders class.

public MessageHeaders(IEnumerable<KeyValuePair<string, string>> headers)

Parameters

headers IEnumerable<KeyValuePair<string, string>>

The headers.

Properties

Count

Gets the count.

public int Count { get; }

Property Value

int

The count.

this[string]

Performs the this[string] operation.

public string? this[string key] { get; set; }

Parameters

key string

Property Value

string

Keys

Gets the keys.

public IEnumerable<string> Keys { get; }

Property Value

IEnumerable<string>

The keys.

Values

Gets the values.

public IEnumerable<string> Values { get; }

Property Value

IEnumerable<string>

The values.

Methods

ContainsKey(string)

Performs the contains key operation.

public bool ContainsKey(string key)

Parameters

key string

The key that identifies the value.

Returns

bool

true when the operation succeeds; otherwise, false.

GetEnumerator()

Gets enumerator.

public IEnumerator<KeyValuePair<string, string>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<string, string>>

The result of the get enumerator operation.

Remove(string)

Performs the remove operation.

public bool Remove(string key)

Parameters

key string

The key that identifies the value.

Returns

bool

true when the operation succeeds; otherwise, false.

Set(string, string)

Performs the set operation.

public void Set(string key, string value)

Parameters

key string

The key that identifies the value.

value string

The value to store.

TryGetValue(string, out string)

Attempts to get value.

public bool TryGetValue(string key, out string value)

Parameters

key string

The key that identifies the value.

value string

The value to store.

Returns

bool

true when the operation succeeds; otherwise, false.