Table of Contents

Class XmlDictionaryEntry

Namespace
NanoByte.Common.Collections
Assembly
NanoByte.Common.dll

A key-value string pair for XmlDictionary.

[Serializable]
public sealed class XmlDictionaryEntry : ICloneable<XmlDictionaryEntry>
Inheritance
object
XmlDictionaryEntry
Implements
Extension Methods

Constructors

XmlDictionaryEntry()

Base-constructor for XML serialization. Do not call manually!

public XmlDictionaryEntry()

XmlDictionaryEntry(string, string)

Creates a new entry for XmlDictionary.

public XmlDictionaryEntry(string key, string value)

Parameters

key string

The unique text key.

value string

The text value.

Properties

Key

The unique text key. Warning: If this is changed the XmlDictionary must be rebuilt in order to update its internal hash table.

public string Key { get; set; }

Property Value

string

Exceptions

InvalidOperationException

The new key value already exists in the parent dictionary.

Value

The text value.

public string Value { get; set; }

Property Value

string

Methods

Clone()

Creates a plain copy of this entry.

public XmlDictionaryEntry Clone()

Returns

XmlDictionaryEntry

The cloned entry.

Equals(XmlDictionaryEntry?)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(XmlDictionaryEntry? other)

Parameters

other XmlDictionaryEntry

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

operator ==(XmlDictionaryEntry, XmlDictionaryEntry)

public static bool operator ==(XmlDictionaryEntry left, XmlDictionaryEntry right)

Parameters

left XmlDictionaryEntry
right XmlDictionaryEntry

Returns

bool

operator !=(XmlDictionaryEntry, XmlDictionaryEntry)

public static bool operator !=(XmlDictionaryEntry left, XmlDictionaryEntry right)

Parameters

left XmlDictionaryEntry
right XmlDictionaryEntry

Returns

bool