Class PropertyBagKey
The PropertyBagKey class is used to represent a key in a PropertyBag<TValue>. The IEquatable<PropertyBagKey?> interface is implemented to allow for comparison of PropertyBagKey instances.
[Serializable]
public class PropertyBagKey : IEquatable<PropertyBagKey?>
- Inheritance
-
PropertyBagKey
- Implements
- Inherited Members
Constructors
PropertyBagKey(string)
The PropertyBagKey class is used to represent a key in a PropertyBag<TValue>. The IEquatable<PropertyBagKey?> interface is implemented to allow for comparison of PropertyBagKey instances.
public PropertyBagKey(string key)
Parameters
key
stringThe key parameter represents the string value of the PropertyBagKey instance, which is used to identify this instance in a PropertyBag<TValue>.
Methods
Equals(object?)
Determines whether the current PropertyBagKey object is equal to a specified object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
- bool
true if the current object and obj are both PropertyBagKey objects and have the same value; otherwise, false.
Equals(PropertyBagKey?)
Determines whether the current PropertyBagKey object is equal to another PropertyBagKey object.
public bool Equals(PropertyBagKey? other)
Parameters
other
PropertyBagKeyThe PropertyBagKey object to compare with the current object.
Returns
- bool
true if the current object and other have the same value; otherwise, false.
GetHashCode()
Returns the hash code for the current PropertyBagKey object.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer hash code.
ToString()
Returns a string that represents the current Error object.
public override string ToString()
Returns
- string
A string that represents the current object.
Operators
operator ==(PropertyBagKey?, PropertyBagKey?)
Overloads the == operator and returns a boolean value indicating whether the two specified PropertyBagKey instances are equal.
public static bool operator ==(PropertyBagKey? left, PropertyBagKey? right)
Parameters
left
PropertyBagKeyThe left operand of the comparison operator
right
PropertyBagKeyThe right operand of the comparison operator
Returns
- bool
Boolean value that indicates whether the left parameter is equal to the right parameter
operator !=(PropertyBagKey?, PropertyBagKey?)
Overloads the != operator and returns a boolean value indicating whether the two specified PropertyBagKey instances are not equal.
public static bool operator !=(PropertyBagKey? left, PropertyBagKey? right)
Parameters
left
PropertyBagKeyThe left operand of the comparison operator
right
PropertyBagKeyThe right operand of the comparison operator
Returns
- bool
Boolean value that indicates whether the left parameter is not equal to the right parameter