Пример #1
0
        /// <summary>
        /// Returns true if HistoryItem instances are equal
        /// </summary>
        /// <param name="other">Instance of HistoryItem to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(HistoryItem other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     ProcessId == other.ProcessId ||
                     ProcessId != null &&
                     ProcessId.Equals(other.ProcessId)
                 ) &&
                 (
                     IdentityId == other.IdentityId ||
                     IdentityId != null &&
                     IdentityId.Equals(other.IdentityId)
                 ) &&
                 (
                     AllowedToEmployeeNames == other.AllowedToEmployeeNames ||
                     AllowedToEmployeeNames != null &&
                     AllowedToEmployeeNames.Equals(other.AllowedToEmployeeNames)
                 ) &&
                 (
                     TransitionTime == other.TransitionTime ||
                     TransitionTime != null &&
                     TransitionTime.Equals(other.TransitionTime)
                 ) &&
                 (
                     Order == other.Order ||
                     Order != null &&
                     Order.Equals(other.Order)
                 ) &&
                 (
                     InitialState == other.InitialState ||
                     InitialState != null &&
                     InitialState.Equals(other.InitialState)
                 ) &&
                 (
                     DestinationState == other.DestinationState ||
                     DestinationState != null &&
                     DestinationState.Equals(other.DestinationState)
                 ) &&
                 (
                     Command == other.Command ||
                     Command != null &&
                     Command.Equals(other.Command)
                 ));
        }
Пример #2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (ProcessId != null)
         {
             hashCode = hashCode * 59 + ProcessId.GetHashCode();
         }
         if (IdentityId != null)
         {
             hashCode = hashCode * 59 + IdentityId.GetHashCode();
         }
         if (AllowedToEmployeeNames != null)
         {
             hashCode = hashCode * 59 + AllowedToEmployeeNames.GetHashCode();
         }
         if (TransitionTime != null)
         {
             hashCode = hashCode * 59 + TransitionTime.GetHashCode();
         }
         if (Order != null)
         {
             hashCode = hashCode * 59 + Order.GetHashCode();
         }
         if (InitialState != null)
         {
             hashCode = hashCode * 59 + InitialState.GetHashCode();
         }
         if (DestinationState != null)
         {
             hashCode = hashCode * 59 + DestinationState.GetHashCode();
         }
         if (Command != null)
         {
             hashCode = hashCode * 59 + Command.GetHashCode();
         }
         return(hashCode);
     }
 }