示例#1
0
        public void GetPrice()
        {
            SendPrice sendPrice = async(object obj) =>
            {
                var message = ResponseCreator.Create(new
                {
                    y = DateTime.Now.Millisecond,
                    x = DateTime.Now.Second % 5 == 0 ? DateTime.Now.Second.ToString() : ""
                });

                await _hubContext.Clients.All.SendAsync("Send", message);
            };
            TimerCallback tm    = new TimerCallback(sendPrice);
            Timer         timer = new Timer(tm, null, 0, 1000);
        }
示例#2
0
 public Bill()
 {
     InitializeComponent();
     Sender  = new SendItems(GetItems);
     Sender2 = new SendPrice(GetTotalPrice);
 }