mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
//
|
|
// 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
|
|
{
|
|
/// <summary>
|
|
/// Used to uniquely identify a CancellationTokenSource associated with both
|
|
/// a string URI and a string connection type.
|
|
/// </summary>
|
|
public class CancelTokenKey : CancelConnectParams, IEquatable<CancelTokenKey>
|
|
{
|
|
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();
|
|
}
|
|
}
|
|
}
|