public override object Clone()
        {
            var result = MemberwiseClone() as ProductPrice;

            result.Currency       = Currency?.Clone() as Currency;
            result.DiscountAmount = DiscountAmount?.Clone() as Money;
            result.ListPrice      = ListPrice?.Clone() as Money;
            result.SalePrice      = SalePrice?.Clone() as Money;
            result.TierPrices     = TierPrices?.Select(x => x.Clone() as TierPrice).ToList();
            result.Discounts      = Discounts?.Select(x => x.Clone() as Discount).ToList();

            return(result);
        }
        public override object Clone()
        {
            var result = (ConfiguredGroup)base.Clone();

            result.ListPrice            = ListPrice?.Clone() as Money;
            result.SalePrice            = SalePrice?.Clone() as Money;
            result.ListPriceWithTax     = ListPriceWithTax?.Clone() as Money;
            result.SalePriceWithTax     = SalePriceWithTax?.Clone() as Money;
            result.PlacedPrice          = PlacedPrice?.Clone() as Money;
            result.PlacedPriceWithTax   = PlacedPriceWithTax?.Clone() as Money;
            result.ExtendedPrice        = ExtendedPrice?.Clone() as Money;
            result.ExtendedPriceWithTax = ExtendedPriceWithTax?.Clone() as Money;
            result.TaxTotal             = TaxTotal?.Clone() as Money;

            result.Items = new List <LineItem>();

            return(result);
        }
示例#3
0
        public override object Clone()
        {
            var result = base.Clone() as LineItem;

            result.ListPrice             = ListPrice?.Clone() as Money;
            result.SalePrice             = SalePrice?.Clone() as Money;
            result.DiscountAmount        = DiscountAmount?.Clone() as Money;
            result.DiscountAmountWithTax = DiscountAmountWithTax?.Clone() as Money;
            result.DiscountTotal         = DiscountTotal?.Clone() as Money;
            result.DiscountTotalWithTax  = DiscountTotalWithTax?.Clone() as Money;
            result.ListPriceWithTax      = ListPriceWithTax?.Clone() as Money;
            result.SalePriceWithTax      = SalePriceWithTax?.Clone() as Money;
            result.PlacedPrice           = PlacedPrice?.Clone() as Money;
            result.PlacedPriceWithTax    = PlacedPriceWithTax?.Clone() as Money;
            result.ExtendedPrice         = ExtendedPrice?.Clone() as Money;
            result.ExtendedPriceWithTax  = ExtendedPriceWithTax?.Clone() as Money;
            result.TaxTotal = TaxTotal?.Clone() as Money;

            if (Discounts != null)
            {
                result.Discounts = new List <Discount>(Discounts.Select(x => x.Clone() as Discount));
            }
            if (TaxDetails != null)
            {
                result.TaxDetails = new List <TaxDetail>(TaxDetails.Select(x => x.Clone() as TaxDetail));
            }
            if (DynamicProperties != null)
            {
                result.DynamicProperties = new MutablePagedList <DynamicProperty>(DynamicProperties.Select(x => x.Clone() as DynamicProperty));
            }
            if (ValidationErrors != null)
            {
                result.ValidationErrors = new List <ValidationError>(ValidationErrors.Select(x => x.Clone() as ValidationError));
            }

            return(result);
        }