Exemple #1
0
        public void SendSignal(object state)
        {
            NotificationFactory factory      = NotificationFactory.Instance;
            INotification       notification = factory.CreateNotification(NotificationType.Time);

            // Send
            foreach (var x in TtlClients)
            {
                string username = Encoding.Unicode.GetString((byte[])x.Key.Tag);
                // Strategy Pattern implementation
                ISendStrategy strategy = new ConcreteDefaultSender();
                strategy.SendPacket(notification.CreatePacket(), this, username);
            }

            //EosPacket p = new EosPacket();
            //p.Sender = ReactorServer.Id;
            //p.Data.Add(Encoding.Unicode.GetBytes(DateTime.Now.ToString()));
        }
 public PaymentResult MakePayment(Product pProduct)
 {
     try
     {
         NotificationFactory notificationFactory = new NotificationFactory();
         PaymentFactory      paymentFactory      = new PaymentFactory(_commission, _membership, notificationFactory.CreateNotification(NotificationFactory.enmNotificationType.Email));
         IPayment            payment             = paymentFactory.CreatePayment(pProduct);
         return(payment.MakePayment(pProduct));
     }
     catch (Exception)
     {
         throw;
     }
 }