public Boolean Equals(Win32ResourceName other) { if (Object.ReferenceEquals(this, other)) { return(true); } if (Object.ReferenceEquals(other, null)) { return(false); } if (!ParentType.Equals(other.ParentType)) { return(false); } if (NameInt > -1 && NameInt == other.NameInt) { return(true); // Name is greater than -1 (use string) and numerical Name id is the same } if (NameInt == -1 && other.NameInt == -1) { return(NameStr.Equals(other.NameStr)); } return(false); }
/// <summary> /// Returns true if Order instances are equal /// </summary> /// <param name="other">Instance of Order to be compared</param> /// <returns>Boolean</returns> public bool Equals(Order other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Instrument == other.Instrument || Instrument != null && Instrument.Equals(other.Instrument) ) && ( Qty == other.Qty || Qty != null && Qty.Equals(other.Qty) ) && ( Side == other.Side || Side != null && Side.Equals(other.Side) ) && ( Type == other.Type || Type != null && Type.Equals(other.Type) ) && ( FilledQty == other.FilledQty || FilledQty != null && FilledQty.Equals(other.FilledQty) ) && ( AvgPrice == other.AvgPrice || AvgPrice != null && AvgPrice.Equals(other.AvgPrice) ) && ( LimitPrice == other.LimitPrice || LimitPrice != null && LimitPrice.Equals(other.LimitPrice) ) && ( StopPrice == other.StopPrice || StopPrice != null && StopPrice.Equals(other.StopPrice) ) && ( ParentId == other.ParentId || ParentId != null && ParentId.Equals(other.ParentId) ) && ( ParentType == other.ParentType || ParentType != null && ParentType.Equals(other.ParentType) ) && ( Duration == other.Duration || Duration != null && Duration.Equals(other.Duration) ) && ( Status == other.Status || Status != null && Status.Equals(other.Status) )); }