e79aa3c0ed
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
66 lines
1.6 KiB
C#
66 lines
1.6 KiB
C#
// <copyright>
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace System.ServiceModel.Activities
|
|
{
|
|
using System.Activities;
|
|
using System.Collections.Generic;
|
|
|
|
internal class WorkflowIdentityKey : IEquatable<WorkflowIdentityKey>
|
|
{
|
|
public WorkflowIdentityKey(WorkflowIdentity definitionIdentity)
|
|
{
|
|
this.Identity = definitionIdentity;
|
|
}
|
|
|
|
public WorkflowIdentity Identity
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
int hashCode = 0;
|
|
|
|
if (this.Identity != null)
|
|
{
|
|
hashCode ^= this.Identity.GetHashCode();
|
|
}
|
|
|
|
return hashCode;
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
WorkflowIdentityKey workflowIdentityKey = obj as WorkflowIdentityKey;
|
|
if (workflowIdentityKey == null)
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return this.Equals(workflowIdentityKey);
|
|
}
|
|
}
|
|
|
|
public bool Equals(WorkflowIdentityKey other)
|
|
{
|
|
if (other != null)
|
|
{
|
|
if (this.Identity != null)
|
|
{
|
|
return this.Identity.Equals(other.Identity);
|
|
}
|
|
else
|
|
{
|
|
return object.ReferenceEquals(this.Identity, other.Identity);
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|