Class MessageMap
Maps message names between clients.
public sealed class MessageMap : IReadOnlyDictionary<Identifier, MessageNames>, IReadOnlyCollection<KeyValuePair<Identifier, MessageNames>>, IEnumerable<KeyValuePair<Identifier, MessageNames>>, IEnumerable
- Inheritance
-
MessageMap
- Implements
Properties
Count
Gets the number of elements in the collection.
public int Count { get; }
Property Value
- int
The number of elements in the collection.
this[Identifier]
Gets the element that has the specified key in the read-only dictionary.
public MessageNames this[Identifier key] { get; }
Parameters
key
IdentifierThe key to locate.
Property Value
- MessageNames
The element that has the specified key in the read-only dictionary.
Exceptions
- ArgumentNullException
key
is null.- KeyNotFoundException
The property is retrieved and
key
is not found.
Keys
Gets an enumerable collection that contains the keys in the read-only dictionary.
public IEnumerable<Identifier> Keys { get; }
Property Value
- IEnumerable<Identifier>
An enumerable collection that contains the keys in the read-only dictionary.
Values
Gets an enumerable collection that contains the values in the read-only dictionary.
public IEnumerable<MessageNames> Values { get; }
Property Value
- IEnumerable<MessageNames>
An enumerable collection that contains the values in the read-only dictionary.
Methods
ContainsKey(Identifier)
Determines whether the read-only dictionary contains an element that has the specified key.
public bool ContainsKey(Identifier key)
Parameters
key
IdentifierThe key to locate.
Returns
- bool
true if the read-only dictionary contains an element that has the specified key; otherwise, false.
Exceptions
- ArgumentNullException
key
is null.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<KeyValuePair<Identifier, MessageNames>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<Identifier, MessageNames>>
An enumerator that can be used to iterate through the collection.
Load(string)
public static MessageMap Load(string filePath)
Parameters
filePath
string
Returns
TryGetValue(Identifier, out MessageNames)
Gets the value that is associated with the specified key.
public bool TryGetValue(Identifier key, out MessageNames value)
Parameters
key
IdentifierThe key to locate.
value
MessageNamesWhen this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the
value
parameter. This parameter is passed uninitialized.
Returns
- bool
true if the object that implements the IReadOnlyDictionary<TKey, TValue> interface contains an element that has the specified key; otherwise, false.
Exceptions
- ArgumentNullException
key
is null.