コード例 #1
0
        private void StorageOnErrorRecieved(object sender, ErrorRecievedEventArgs errorRecievedEventArgs)
        {
            if (errorRecievedEventArgs.ErrorMessage is IErrorMessage message)
            {
                Execute(() =>
                {
                    _databaseLog.SetError(message);
                });

                eventLog.WriteEntry(
                    $"{message.Status}, messageId:{message.MessageId}, {message.ErrorMessage}",
                    EventLogEntryType.Information);

                _ackQueue.Push(new AckQueueMessage()
                {
                    MessageId = message.MessageId.ToString(),
                    Valid     = true
                });
            }
        }
コード例 #2
0
        private async void BtnAck_OnItemClick(object sender, ItemClickEventArgs e)
        {
            await ForeachOnSelectedRows(delegate(Message message, CancellationToken token)
            {
                if (!message.NeedAck)
                {
                    return;
                }

                var ackQueue = new AckQueue(Settings.Default.RABBIT_SERVER, Settings.Default.RABBIT_USER, Settings.Default.RABBIT_PASS);

                ackQueue.Push(new AckQueueMessage()
                {
                    MessageId = message.MessageId.ToString(),
                    Valid     = true
                });
            }, new ForEachOnSelectedRowsSettings()
            {
                OperationName = e.Item.Hint.ToString(),
                Refresh       = true
            });
        }