Пример #1
0
        private string GetMessageSelectorValue(string fieldName)
        {
            if (!fieldSelectors.ContainsKey(fieldName) || messageId == null)
            {
                return(string.Empty);
            }

            MessageDataRow dataRow = this.monitor.GetMessageDisplayData((MessageId)messageId, fieldSelectors[fieldName]);

            if (dataRow.Values == null || dataRow.Values[0] == null)
            {
                return(string.Empty);
            }

            return(dataRow.Values[0].ToString());
        }
Пример #2
0
        private void RefreshMetadataAndTopics(bool onlyAddNewMessages)
        {
            var metadataState = GetMetadataUsingFilters();

            if (metadataState == null)
            {
                // Failed to get metadata
                return;
            }

            if (onlyAddNewMessages)
            {
                // Resolving the IDs of already added messages
                var alreadyAdded = GetNrsOfAlreadyAddedMessages();

                // Adding a row for each metadata item if new
                foreach (var i in metadataState.Items)
                {
                    if (!alreadyAdded.Contains(i.RunningId))
                    {
                        var row = new MessageDataRow(i);
                        ReceivedMessagesDataGrid.Items.Add(row);
                    }
                }
            }
            else
            {
                // Adding a row for each metadata item
                foreach (var i in metadataState.Items)
                {
                    var row = new MessageDataRow(i);
                    ReceivedMessagesDataGrid.Items.Add(row);
                }
            }

            // Refreshing topics
            RefreshTopics(metadataState);
        }