Ejemplo n.º 1
0
        private void HitCheckTask_NotifySwitchItem(object sender, EventArgs e)
        {
            if (_isPost)
            {
                return;
            }
            var messages = HitTaskCache.GetMessages();

            //foreach (var message in messages)
            //{
            //    Debug.WriteLine($"  stamp: {message.Stamp.ToString().Remove(8)} switchnumber: {message.SwitchItem.SwitchNumber} devicenumber: {message.DeviceNumber} switchstatus: {message.SwitchItem.SwitchStatus} queuecount: {HitTaskCache.CountQueue()}");
            //}

            _isPost = true;
            PostResult(messages);
        }
Ejemplo n.º 2
0
        private void Callback_Notify(object sender, WcfResultInfo e)
        {
            if (e.IsError)
            {
                return;
            }
            var switchItem = e.Data.ToObject <SwitchItem>();
            var stamp      = Guid.NewGuid();
            //Debug.WriteLine($"STAMP: {stamp.ToString().Remove(8)} SWITCHNUMBER: {switchItem.SwitchNumber} DEVICENUMBER: {_devicenumber} SWITCHSTATUS: {switchItem.SwitchStatus}");
            var switchItemWithDeviceNumber = new SwitchItemWithDeviceNumber
            {
                Stamp        = stamp,
                SwitchItem   = switchItem,
                DeviceNumber = _devicenumber
            };

            HitTaskCache.PushMessage(switchItemWithDeviceNumber);
            OnNotifySwitchItem();
        }