1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
// <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;
}
}
}
|