private ListViewItem ComposeTraceListItem(TraceRecord tr)
        {
            InternalMessageInfo internalMessageInfo = ExtraceMessageLog(tr);
            int num = -1;

            if (tr.MessageProperties == MessageProperty.MessageIn)
            {
                num = TraceViewerForm.GetImageIndexFromImageList(Images.MessageReceiveTrace);
            }
            else if (tr.MessageProperties == MessageProperty.MessageOut)
            {
                num = TraceViewerForm.GetImageIndexFromImageList(Images.MessageSentTrace);
            }
            ListViewItem listViewItem = null;

            listViewItem = ((num == -1) ? new ListViewItem(new string[5]
            {
                (internalMessageInfo != null && !string.IsNullOrEmpty(internalMessageInfo.Action)) ? internalMessageInfo.Action : string.Empty,
                Utilities.GetShortTimeStringFromDateTime(tr.Time),
                string.IsNullOrEmpty(tr.Execution.ComputerName) ? tr.Execution.ProcessName : (tr.Execution.ComputerName + SR.GetString("SL_ExecutionSep") + tr.Execution.ProcessName),
                TraceViewerForm.GetActivityDisplayName(tr.ActivityID),
                (internalMessageInfo != null && !string.IsNullOrEmpty(internalMessageInfo.To)) ? internalMessageInfo.To : string.Empty
            }) : new ListViewItem(new string[5]
            {
                (internalMessageInfo != null && !string.IsNullOrEmpty(internalMessageInfo.Action)) ? internalMessageInfo.Action : string.Empty,
                Utilities.GetShortTimeStringFromDateTime(tr.Time),
                string.IsNullOrEmpty(tr.Execution.ComputerName) ? tr.Execution.ProcessName : (tr.Execution.ComputerName + SR.GetString("SL_ExecutionSep") + tr.Execution.ProcessName),
                TraceViewerForm.GetActivityDisplayName(tr.ActivityID),
                (internalMessageInfo != null && !string.IsNullOrEmpty(internalMessageInfo.To)) ? internalMessageInfo.To : string.Empty
            }, num));
            listViewItem.Tag = tr;
            if (currentDataSource != null && currentDataSource.Activities.ContainsKey(tr.ActivityID))
            {
                if (currentDataSource.Activities[tr.ActivityID].HasError)
                {
                    listViewItem.ForeColor = Color.Red;
                    ListViewItem listViewItem2 = listViewItem;
                    listViewItem2.Font = new Font(listViewItem2.Font, listViewItem.Font.Style | FontStyle.Bold);
                }
                else if (currentDataSource.Activities[tr.ActivityID].HasWarning)
                {
                    listViewItem.BackColor = Color.Yellow;
                }
            }
            return(listViewItem);
        }