Exemplo n.º 1
0
        private void AnalyzeCrossExecutionMessageExchange()
        {
            Dictionary <string, List <TraceRecordCellItem> > dictionary  = new Dictionary <string, List <TraceRecordCellItem> >();
            Dictionary <string, TraceRecordCellItem>         dictionary2 = new Dictionary <string, TraceRecordCellItem>();
            Dictionary <string, TraceRecordCellItem>         dictionary3 = new Dictionary <string, TraceRecordCellItem>();

            foreach (TraceRecordCellItem messageRelatedItem in messageRelatedItems)
            {
                if (!string.IsNullOrEmpty(messageRelatedItem.CurrentTraceRecord.MessageID) || !string.IsNullOrEmpty(messageRelatedItem.CurrentTraceRecord.RelatesToMessageID))
                {
                    string text = messageRelatedItem.CurrentTraceRecord.MessageID;
                    if (string.IsNullOrEmpty(text))
                    {
                        text = "ReplyTo:" + messageRelatedItem.CurrentTraceRecord.RelatesToMessageID;
                    }
                    if (messageRelatedItem.CurrentTraceRecord.IsMessageLogged)
                    {
                        if (!dictionary.ContainsKey(text))
                        {
                            dictionary.Add(text, new List <TraceRecordCellItem>());
                        }
                        dictionary[text].Add(messageRelatedItem);
                    }
                    else if (messageRelatedItem.CurrentTraceRecord.IsMessageSentRecord && !dictionary2.ContainsKey(text))
                    {
                        dictionary2.Add(text, messageRelatedItem);
                    }
                    else if (messageRelatedItem.CurrentTraceRecord.IsMessageReceivedRecord && !dictionary3.ContainsKey(text))
                    {
                        dictionary3.Add(text, messageRelatedItem);
                    }
                }
            }
            foreach (string key in dictionary2.Keys)
            {
                if (dictionary3.ContainsKey(key))
                {
                    MessageExchangeCellItem messageExchangeCellItem = new MessageExchangeCellItem();
                    messageExchangeCellItem.SentExecutionColumnItem    = dictionary2[key].RelatedExecutionItem;
                    messageExchangeCellItem.ReceiveExecutionColumnItem = dictionary3[key].RelatedExecutionItem;
                    messageExchangeCellItem.SentTraceRecordCellItem    = dictionary2[key];
                    messageExchangeCellItem.ReceiveTraceRecordCellItem = dictionary3[key];
                    if (dictionary.ContainsKey(key) && dictionary[key].Count != 0)
                    {
                        messageExchangeCellItem.RelatedMessageTraceCellItems.AddRange(dictionary[key]);
                    }
                    messageExchangeMap.Add(dictionary2[key].CurrentTraceRecord.TraceID, messageExchangeCellItem);
                }
            }
        }
 public MessageExchangeCellControl(IWindowlessControlContainer parentContainer, MessageExchangeCellItem item, IErrorReport errorReport)
     : base(3, parentContainer.GetCurrentScale(), parentContainer, new Point(0, 0), errorReport)
 {
     if (item != null && item.SentTraceRecordCellItem != null && item.ReceiveTraceRecordCellItem != null)
     {
         WindowlessControlBase windowlessControlBase  = base.Container.FindWindowlessControl(item.SentTraceRecordCellItem);
         WindowlessControlBase windowlessControlBase2 = base.Container.FindWindowlessControl(item.ReceiveTraceRecordCellItem);
         if (windowlessControlBase != null && windowlessControlBase2 != null && windowlessControlBase is TraceRecordCellControl && windowlessControlBase2 is TraceRecordCellControl)
         {
             sendExecutionColumnItem    = item.SentExecutionColumnItem;
             receiveExecutionColumnItem = item.ReceiveExecutionColumnItem;
             loggedMessageItems         = item.RelatedMessageTraceCellItems;
             isToArrow         = (sendExecutionColumnItem.ItemIndex < receiveExecutionColumnItem.ItemIndex);
             isInSameExecution = (sendExecutionColumnItem.ItemIndex == receiveExecutionColumnItem.ItemIndex);
             InitializeRedrawData((TraceRecordCellControl)windowlessControlBase, (TraceRecordCellControl)windowlessControlBase2);
             relatedControls.Add(windowlessControlBase);
             relatedControls.Add(windowlessControlBase2);
             if (loggedMessageItems != null && loggedMessageItems.Count != 0)
             {
                 foreach (TraceRecordCellItem loggedMessageItem in loggedMessageItems)
                 {
                     WindowlessControlBase windowlessControlBase3 = base.Container.FindWindowlessControl(loggedMessageItem);
                     if (windowlessControlBase3 != null && windowlessControlBase3 is TraceRecordCellControl)
                     {
                         relatedControls.Add(windowlessControlBase3);
                     }
                 }
             }
             relatedControls.Add(this);
             foreach (WindowlessControlBase relatedControl in relatedControls)
             {
                 if (relatedControl is TraceRecordCellControl)
                 {
                     AddRelatedControlsForTraceRecord((TraceRecordCellControl)relatedControl, relatedControls);
                 }
             }
         }
     }
 }