コード例 #1
0
            public void SendGetLocalMessagesMqMessage(bool isFast)
            {
                if (this._minerClientVm == null || !IsMinerClientMessagesVisible)
                {
                    return;
                }
                foreach (var vm in _vms)
                {
                    vm.OnPropertyChanged(nameof(LocalMessageDtoViewModel.TimestampText));
                }
                if (_preSendMqMessageOn.AddSeconds(4) > DateTime.Now && _preMinerClientVm == _minerClientVm)
                {
                    return;
                }
                _preSendMqMessageOn = DateTime.Now;
                _preMinerClientVm   = _minerClientVm;
                long afterTime     = 0;
                var  minerClientVm = this._minerClientVm;

                lock (_locker) {
                    var item = _vms.FirstOrDefault();
                    if (item != null)
                    {
                        afterTime = item.Timestamp;
                    }
                }
                if (isFast)
                {
                    MinerStudioService.FastGetLocalMessagesAsync(minerClientVm, afterTime);
                }
                else
                {
                    MinerStudioService.GetLocalMessagesAsync(minerClientVm, afterTime);
                }
            }