/// <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) )); }
public bool Equals(PDA <A, S> other) { var part1 = AcceptanceCondition.Equals(other.AcceptanceCondition); var part2 = Deterministic == other.Deterministic; var part3 = InitialState.Equals(other.InitialState); var part4 = FirstStackSymbol.Equals(other.FirstStackSymbol); var part5 = AllStackSymbols.OrderBy(s => s.ToString()).SequenceEqual(other.AllStackSymbols.OrderBy(s => s.ToString())); var part6 = States.Values.OrderBy(s => s.Id).SequenceEqual(other.States.Values.OrderBy(s => s.Id)); return(part1 && part2 && part3 && part4 && part5 && part6); }
public bool Equals(StateTransition <S> other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(InitialState.Equals(other.InitialState) && EndState.Equals(other.EndState)); }