コード例 #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is OrderFulfillmentPickupDetails other &&
                   ((Recipient == null && other.Recipient == null) || (Recipient?.Equals(other.Recipient) == true)) &&
                   ((ExpiresAt == null && other.ExpiresAt == null) || (ExpiresAt?.Equals(other.ExpiresAt) == true)) &&
                   ((AutoCompleteDuration == null && other.AutoCompleteDuration == null) || (AutoCompleteDuration?.Equals(other.AutoCompleteDuration) == true)) &&
                   ((ScheduleType == null && other.ScheduleType == null) || (ScheduleType?.Equals(other.ScheduleType) == true)) &&
                   ((PickupAt == null && other.PickupAt == null) || (PickupAt?.Equals(other.PickupAt) == true)) &&
                   ((PickupWindowDuration == null && other.PickupWindowDuration == null) || (PickupWindowDuration?.Equals(other.PickupWindowDuration) == true)) &&
                   ((PrepTimeDuration == null && other.PrepTimeDuration == null) || (PrepTimeDuration?.Equals(other.PrepTimeDuration) == true)) &&
                   ((Note == null && other.Note == null) || (Note?.Equals(other.Note) == true)) &&
                   ((PlacedAt == null && other.PlacedAt == null) || (PlacedAt?.Equals(other.PlacedAt) == true)) &&
                   ((AcceptedAt == null && other.AcceptedAt == null) || (AcceptedAt?.Equals(other.AcceptedAt) == true)) &&
                   ((RejectedAt == null && other.RejectedAt == null) || (RejectedAt?.Equals(other.RejectedAt) == true)) &&
                   ((ReadyAt == null && other.ReadyAt == null) || (ReadyAt?.Equals(other.ReadyAt) == true)) &&
                   ((ExpiredAt == null && other.ExpiredAt == null) || (ExpiredAt?.Equals(other.ExpiredAt) == true)) &&
                   ((PickedUpAt == null && other.PickedUpAt == null) || (PickedUpAt?.Equals(other.PickedUpAt) == true)) &&
                   ((CanceledAt == null && other.CanceledAt == null) || (CanceledAt?.Equals(other.CanceledAt) == true)) &&
                   ((CancelReason == null && other.CancelReason == null) || (CancelReason?.Equals(other.CancelReason) == true)) &&
                   ((IsCurbsidePickup == null && other.IsCurbsidePickup == null) || (IsCurbsidePickup?.Equals(other.IsCurbsidePickup) == true)) &&
                   ((CurbsidePickupDetails == null && other.CurbsidePickupDetails == null) || (CurbsidePickupDetails?.Equals(other.CurbsidePickupDetails) == true)));
        }
コード例 #2
0
        protected void Check(Identifiable other)
        {
            Guard.AssertNotNull(other, nameof(other));

            if (SchemeVersion != other.SchemeVersion)
            {
                throw new PolymorphicPseudonymisationException($"Scheme version {SchemeVersion} is not equal to {other.SchemeVersion}");
            }

            if (SchemeKeyVersion != other.SchemeKeyVersion)
            {
                throw new PolymorphicPseudonymisationException(
                          $"Scheme key version {SchemeKeyVersion} is not equal to {other.SchemeKeyVersion}");
            }

            if (!Recipient.Equals(other.Recipient, StringComparison.InvariantCultureIgnoreCase))
            {
                throw new PolymorphicPseudonymisationException($"Recipient '{Recipient}' is not equal to '{other.Recipient}'");
            }

            if ((ShouldCheckSetVersion || other.ShouldCheckSetVersion) && RecipientKeySetVersion != other.RecipientKeySetVersion)
            {
                throw new PolymorphicPseudonymisationException(
                          $"Recipient key set version {RecipientKeySetVersion} does not match key {other.RecipientKeySetVersion}");
            }
        }
コード例 #3
0
 public BusinessTrade GetTradeData(IProduct product, IUserSettings settings)
 {
     if (!IsSwap())
     {
         return(new BusinessTrade()
         {
             Hash = Hash,
             Date = ConfirmedAt,
             IsTradeable = product.Market.IsTradeable,
             IsInbound = IsInbound(),
             Quantity = GetTransferQuantity(TransferAction, settings),
             NetCurrentPricePerToken = product.Nav.ValuePerToken,
             NetSnapshotPricePerToken = Price.NetAssetValuePerToken,
             MarketCurrentPricePerToken = product.Market.IsTradeable
                 ? product.Market.PricePerToken
                 : default(decimal?),
             MarketSnapshotPricePerToken = product.Market.IsTradeable
                 ? GetTransferPricePerToken(TransferAction, settings)
                 : default(decimal?),
             IsStakeLockup = Recipient.Equals(settings.StakingAddress, StringComparison.OrdinalIgnoreCase),
             IsStakeRelease = Operations.Any(x =>
                                             x.Type == OperationTypes.Transfer &&
                                             x.Sender.Equals(settings.StakingAddress, StringComparison.OrdinalIgnoreCase)),
             IsOwned = settings.SecondaryWalletAddresses.Contains(Recipient) || settings.SecondaryWalletAddresses.Contains(Sender),
             IsBurn = Operations.Any(x =>
                                     x.Contract.Address.Equals(ContractAddress, StringComparison.OrdinalIgnoreCase) &&
                                     x.Recipient.Equals(ZeroAddress, StringComparison.OrdinalIgnoreCase))
         });
     }
     else
     {
         throw new PermanentException($"{Hash} is not a trade.");
     }
 }
コード例 #4
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is OrderFulfillmentShipmentDetails other &&
                   ((Recipient == null && other.Recipient == null) || (Recipient?.Equals(other.Recipient) == true)) &&
                   ((Carrier == null && other.Carrier == null) || (Carrier?.Equals(other.Carrier) == true)) &&
                   ((ShippingNote == null && other.ShippingNote == null) || (ShippingNote?.Equals(other.ShippingNote) == true)) &&
                   ((ShippingType == null && other.ShippingType == null) || (ShippingType?.Equals(other.ShippingType) == true)) &&
                   ((TrackingNumber == null && other.TrackingNumber == null) || (TrackingNumber?.Equals(other.TrackingNumber) == true)) &&
                   ((TrackingUrl == null && other.TrackingUrl == null) || (TrackingUrl?.Equals(other.TrackingUrl) == true)) &&
                   ((PlacedAt == null && other.PlacedAt == null) || (PlacedAt?.Equals(other.PlacedAt) == true)) &&
                   ((InProgressAt == null && other.InProgressAt == null) || (InProgressAt?.Equals(other.InProgressAt) == true)) &&
                   ((PackagedAt == null && other.PackagedAt == null) || (PackagedAt?.Equals(other.PackagedAt) == true)) &&
                   ((ExpectedShippedAt == null && other.ExpectedShippedAt == null) || (ExpectedShippedAt?.Equals(other.ExpectedShippedAt) == true)) &&
                   ((ShippedAt == null && other.ShippedAt == null) || (ShippedAt?.Equals(other.ShippedAt) == true)) &&
                   ((CanceledAt == null && other.CanceledAt == null) || (CanceledAt?.Equals(other.CanceledAt) == true)) &&
                   ((CancelReason == null && other.CancelReason == null) || (CancelReason?.Equals(other.CancelReason) == true)) &&
                   ((FailedAt == null && other.FailedAt == null) || (FailedAt?.Equals(other.FailedAt) == true)) &&
                   ((FailureReason == null && other.FailureReason == null) || (FailureReason?.Equals(other.FailureReason) == true)));
        }
コード例 #5
0
        public bool Equals(IMessage other)
        {
            bool result =
                Id == other.Id &&
                Text == other.Text &&
                Sender.Equals(other.Sender) &&
                Recipient.Equals(other.Recipient);

            return(result);
        }
コード例 #6
0
 public bool Equals(Cargo other)
 {
     return(other != null && Code.Equals(other.Code) &&
            Volume.Equals(other.Volume) &&
            Count.Equals(other.Count) &&
            DispatchDate.Equals(other.DispatchDate) &&
            CargoType.Equals(other.CargoType) &&
            Sender.Equals(other.Sender) &&
            Recipient.Equals(other.Recipient) &&
            ShipmentStation.Equals(other.ShipmentStation) &&
            DestinationStation.Equals(other.DestinationStation));
 }
コード例 #7
0
 public bool Equals(Entry other)
 {
     return(other != null && Code.Equals(other.Code) &&
            Volume.Equals(other.Volume) &&
            Count.Equals(other.Count) &&
            Date.Equals(other.Date) &&
            Type.Equals(other.Type) &&
            Sender.Equals(other.Sender) &&
            Recipient.Equals(other.Recipient) &&
            ShipmentCountry.Equals(other.ShipmentCountry) &&
            ShipmentState.Equals(other.ShipmentState) &&
            ShipmentRailRoad.Equals(other.ShipmentRailRoad) &&
            ShipmentStation.Equals(other.ShipmentStation) &&
            DestinationCountry.Equals(other.DestinationCountry) &&
            DestinationState.Equals(other.DestinationState) &&
            DestinationRailRoad.Equals(other.DestinationRailRoad) &&
            DestinationStation.Equals(other.DestinationStation));
 }
コード例 #8
0
        public override bool Equals(object obj)
        {
            if (obj == this)
            {
                return(true);
            }

            if (!(obj is AddressData addressData))
            {
                return(false);
            }

            return((PostalCountry == null
                    ? addressData.PostalCountry == null
                    : PostalCountry.Equals(addressData.PostalCountry)) &&
                   (!AddressLines.Any()
                    ? !addressData.AddressLines.Any()
                    : AddressLines.Equals(addressData.AddressLines)) &&
                   (AdministrativeArea == null
                    ? addressData.AdministrativeArea == null
                    : AdministrativeArea.Equals(addressData.AdministrativeArea)) &&
                   (Locality == null
                    ? addressData.Locality == null
                    : Locality.Equals(addressData.Locality)) &&
                   (DependentLocality == null
                    ? addressData.DependentLocality == null
                    : DependentLocality.Equals(addressData.DependentLocality)) &&
                   (PostalCode == null
                    ? addressData.PostalCode == null
                    : PostalCode.Equals(addressData.PostalCode)) &&
                   (SortingCode == null
                    ? addressData.SortingCode == null
                    : SortingCode.Equals(addressData.SortingCode)) &&
                   (Organization == null
                    ? addressData.Organization == null
                    : Organization.Equals(addressData.Organization)) &&
                   (Recipient == null
                    ? addressData.Recipient == null
                    : Recipient.Equals(addressData.Recipient)) &&
                   (LanguageCode == null
                    ? addressData.LanguageCode == null
                    : LanguageCode.Equals(addressData.LanguageCode)));
        }
コード例 #9
0
        protected void Check(Identifiable other)
        {
            if (SchemeVersion != other.SchemeVersion)
            {
                throw new PolymorphicPseudonymisationException($"Scheme version {SchemeVersion} is not equal to {other.SchemeVersion}");
            }

            if (SchemeKeyVersion != other.SchemeKeyVersion)
            {
                throw new PolymorphicPseudonymisationException(
                          $"Scheme key version {SchemeKeyVersion} is not equal to {other.SchemeKeyVersion}");
            }

            if (!Recipient.Equals(other.Recipient))
            {
                throw new PolymorphicPseudonymisationException($"Recipient '{Recipient}' is not equal to '{other.Recipient}'");
            }

            if ((ShouldCheckSetVersion || other.ShouldCheckSetVersion) && RecipientKeySetVersion != other.RecipientKeySetVersion)
            {
                throw new PolymorphicPseudonymisationException(
                          $"Recipient key set version {RecipientKeySetVersion} does not match key {other.RecipientKeySetVersion}");
            }
        }
コード例 #10
0
 public virtual bool Targets(object recipient)
 {
     return
         (ReferenceEquals(Recipient, recipient) ||
          Recipient.Equals(recipient));
 }