Jo Shields 3c1f479b9d Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
2015-04-07 09:35:12 +01:00

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;
}
}
}