// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // using System; using Microsoft.SqlTools.ServiceLayer.Connection.Contracts; namespace Microsoft.SqlTools.ServiceLayer.Connection { /// /// Used to uniquely identify a CancellationTokenSource associated with both /// a string URI and a string connection type. /// public class CancelTokenKey : CancelConnectParams, IEquatable { public override bool Equals(object obj) { CancelTokenKey other = obj as CancelTokenKey; if (other == null) { return false; } return other.OwnerUri == OwnerUri && other.Type == Type; } public bool Equals(CancelTokenKey obj) { return obj.OwnerUri == OwnerUri && obj.Type == Type; } public override int GetHashCode() { return OwnerUri.GetHashCode() ^ Type.GetHashCode(); } } }