KeyPair<Key1, Key2>
using System;
namespace Microsoft.CSharp.RuntimeBinder.Semantics
{
internal struct KeyPair<Key1, Key2> : IEquatable<KeyPair<Key1, Key2>>
{
private readonly Key1 _pKey1;
private readonly Key2 _pKey2;
public KeyPair(Key1 pKey1, Key2 pKey2)
{
_pKey1 = pKey1;
_pKey2 = pKey2;
}
public bool Equals(KeyPair<Key1, Key2> other)
{
if (object.Equals(_pKey1, other._pKey1))
return object.Equals(_pKey2, other._pKey2);
return false;
}
public override bool Equals(object obj)
{
if (!(obj is KeyPair<Key1, Key2>))
return false;
return Equals((KeyPair<Key1, Key2>)obj);
}
public override int GetHashCode()
{
return ((_pKey1 != null) ? _pKey1.GetHashCode() : 0) + ((_pKey2 != null) ? _pKey2.GetHashCode() : 0);
}
}
}