Beispiel #1
0
 public FlashSale(DiscountApplier discountApplier, int expirationInMilliseconds) : base(discountApplier)
 {
     _rate           = 0.05m;
     _timer          = new Timer(expirationInMilliseconds);
     _timer.Elapsed += OnDiscountExpiration;
     _timer.Start();
 }
Beispiel #2
0
        public DailySale(DiscountApplier discountApplier) : base(discountApplier)
        {
            _rate = 0.50m;

            _timer          = new Timer(15000); // Ten seconds just to visualize the funcionallity.
            _timer.Elapsed += OnDiscountExpiration;
            _timer.Start();
        }
Beispiel #3
0
 public FirstPurchaseDiscount(DiscountApplier discountApplier) : base(discountApplier)
 {
     _rate = 0.20m;
 }
Beispiel #4
0
 public Discount(DiscountApplier discountApplier)
 {
     _discountApplier = discountApplier;
 }