示例#1
0
 public FlashSale(DiscountApplier discountApplier, int expirationInMilliseconds) : base(discountApplier)
 {
     _rate           = 0.05m;
     _timer          = new Timer(expirationInMilliseconds);
     _timer.Elapsed += OnDiscountExpiration;
     _timer.Start();
 }
示例#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();
        }
示例#3
0
 public FirstPurchaseDiscount(DiscountApplier discountApplier) : base(discountApplier)
 {
     _rate = 0.20m;
 }
示例#4
0
 public Discount(DiscountApplier discountApplier)
 {
     _discountApplier = discountApplier;
 }