public static Size GetControlSize(WindowlessControlScale scale, TraceRecordCellItem parentTraceItem)
        {
            if (parentTraceItem.RelatedTraceRecordCellItem != null)
            {
                int itemIndex  = parentTraceItem.RelatedActivityItem.ItemIndex;
                int itemIndex2 = parentTraceItem.RelatedTraceRecordCellItem.RelatedActivityItem.ItemIndex;
                int num        = (itemIndex > itemIndex2) ? (itemIndex - itemIndex2) : (itemIndex2 - itemIndex);
                int activityColumnBlockWidth = TraceRecordCellControl.GetActivityColumnBlockWidth(scale, num);
                if (num > 0)
                {
                    switch (scale)
                    {
                    case WindowlessControlScale.Normal:
                        return(new Size(activityColumnBlockWidth, 5));

                    case WindowlessControlScale.Small:
                        return(new Size(activityColumnBlockWidth, 3));

                    case WindowlessControlScale.XSmall:
                        return(new Size(activityColumnBlockWidth, 3));
                    }
                }
            }
            return(new Size(0, 0));
        }
Beispiel #2
0
 public bool MoveNext()
 {
     if (!IsAllExecutionColumnItemEmpty())
     {
         List <TraceRecordCellItem> list = new List <TraceRecordCellItem>();
         DateTime minDateTime            = GetMinDateTime();
         foreach (ExecutionColumnItem executionItem in executionItems)
         {
             if (executionItem.GetTopTraceRecordCellItem() != null && executionItem.GetTopTraceRecordCellItem().CurrentTraceRecord.Time == minDateTime)
             {
                 TraceRecordCellItem topTraceRecordCellItem = executionItem.GetTopTraceRecordCellItem();
                 list.Add(topTraceRecordCellItem);
                 SaveResultTraceRecordCellItem(topTraceRecordCellItem);
                 executionItem.RemoveTopTraceRecordCellItem();
                 if (topTraceRecordCellItem.CurrentTraceRecord.IsTransfer && executionItem.GetTopTraceRecordCellItem() != null && topTraceRecordCellItem.CurrentTraceRecord.TraceID == executionItem.GetTopTraceRecordCellItem().CurrentTraceRecord.TraceID)
                 {
                     TraceRecordCellItem topTraceRecordCellItem2 = executionItem.GetTopTraceRecordCellItem();
                     list.Add(topTraceRecordCellItem2);
                     SaveResultTraceRecordCellItem(topTraceRecordCellItem2);
                     executionItem.RemoveTopTraceRecordCellItem();
                 }
             }
         }
         currentHorzBundRowItem = new HorzBundRowItem(list, executionItems);
         return(true);
     }
     currentHorzBundRowItem = null;
     return(false);
 }
 public ActivityTransferCellControl(TraceRecordCellItem parentTraceItem, IWindowlessControlContainer parentContainer, Point location, IErrorReport errorReport)
     : base(1, parentContainer.GetCurrentScale(), parentContainer, location, errorReport)
 {
     this.parentTraceItem = parentTraceItem;
     base.BackColor       = defaultBackColor;
     base.ForeColor       = defaultForeColor;
     isToArrow            = ((parentTraceItem.RelatedActivityItem.ItemIndex <= parentTraceItem.RelatedTraceRecordCellItem.RelatedActivityItem.ItemIndex) ? true : false);
     isLeft    = ((parentTraceItem.RelatedActivityItem.ItemIndex >= parentTraceItem.RelatedTraceRecordCellItem.RelatedActivityItem.ItemIndex) ? true : false);
     base.Size = GetControlSize(base.Scale, parentTraceItem);
 }
Beispiel #4
0
 private void SaveResultTraceRecordCellItem(TraceRecordCellItem cellItem)
 {
     if (cellItem != null && cellItem.CurrentTraceRecord != null)
     {
         if (!resultTraceRecordCellItems.ContainsKey(cellItem.RelatedActivityItem.CurrentActivity.Id))
         {
             resultTraceRecordCellItems.Add(cellItem.RelatedActivityItem.CurrentActivity.Id, new List <TraceRecordCellItem>());
         }
         resultTraceRecordCellItems[cellItem.RelatedActivityItem.CurrentActivity.Id].Add(cellItem);
     }
 }
        public TraceRecordCellControl(TraceRecordCellItem traceItem, IWindowlessControlContainer parentContainer, Point location, ActivityColumnItem activityColumnItem, ExecutionCellControl executionCellCtrl, IErrorReport errorReport)
            : base(2, parentContainer.GetCurrentScale(), parentContainer, location, errorReport)
        {
            currentTraceRecordItem    = traceItem;
            this.executionCellCtrl    = executionCellCtrl;
            currentActivityColumnItem = activityColumnItem;
            isToChildActivity         = (CurrentTraceRecordItem != null && CurrentTraceRecordItem.IsToChildTransferTrace);
            if (activityColumnItem.IsActiveActivity)
            {
                base.BackColor = activeBackColor;
            }
            else if (activityColumnItem.PairedActivityIndex == 0)
            {
                base.BackColor = defaultBackColor;
            }
            else
            {
                base.BackColor = base.Container.GetRandColorByIndex(activityColumnItem.PairedActivityIndex);
            }
            base.Size = GetControlSize(base.Scale);
            switch (base.Scale)
            {
            case WindowlessControlScale.Normal:
                base.FontSize = 8f;
                break;

            case WindowlessControlScale.Small:
                base.FontSize = 6f;
                break;

            case WindowlessControlScale.XSmall:
                base.FontSize = 3f;
                break;
            }
            if (currentTraceRecordItem != null)
            {
                currentTraceRecordItem.RelatedActivityItem.IncrementDrawnTraceRecordItemCount();
            }
            if (isToChildActivity && CurrentTraceRecordItem.CurrentTraceRecord != null && CurrentTraceRecordItem.CurrentTraceRecord.IsTransfer && CurrentTraceRecordItem.CurrentTraceRecord.ActivityID != CurrentTraceRecordItem.CurrentTraceRecord.RelatedActivityID)
            {
                TraceTransferExpandableIconControl item = new TraceTransferExpandableIconControl(base.Container, this, base.ErrorReport);
                base.ChildControls.Add(item);
            }
        }
        public TraceRecordCellItem AppendTraceRecord(TraceRecord trace)
        {
            TraceRecordCellItem result = null;

            if (trace.Execution.ExecutionID == CurrentExecutionInfo.ExecutionID)
            {
                if (!trace.IsTransfer && allActivities.ContainsKey(trace.ActivityID) && (suppressedActivityIds == null || !suppressedActivityIds.Contains(trace.ActivityID)))
                {
                    if (this[trace.ActivityID] == null)
                    {
                        activityItems.Add(trace.ActivityID, new ActivityColumnItem(allActivities[trace.ActivityID], this, activityItemIndics.Count, Analyzer));
                        activityItemIndics.Add(this[trace.ActivityID].ItemIndex, this[trace.ActivityID]);
                    }
                    this[trace.ActivityID].AppendTraceRecord(trace);
                    traceRecordCellItems.Enqueue(this[trace.ActivityID][trace.TraceID]);
                    result = this[trace.ActivityID][trace.TraceID];
                }
                else if (trace.IsTransfer && allActivities.ContainsKey(trace.ActivityID) && allActivities.ContainsKey(trace.RelatedActivityID))
                {
                    if (suppressedActivityIds == null || (!suppressedActivityIds.Contains(trace.ActivityID) && !suppressedActivityIds.Contains(trace.RelatedActivityID)))
                    {
                        if (this[trace.ActivityID] == null)
                        {
                            activityItems.Add(trace.ActivityID, new ActivityColumnItem(allActivities[trace.ActivityID], this, activityItemIndics.Count, Analyzer));
                            activityItemIndics.Add(this[trace.ActivityID].ItemIndex, this[trace.ActivityID]);
                        }
                        this[trace.ActivityID].AppendTraceRecord(trace);
                        traceRecordCellItems.Enqueue(this[trace.ActivityID][trace.TraceID]);
                        result = this[trace.ActivityID][trace.TraceID];
                        if (this[trace.RelatedActivityID] == null)
                        {
                            activityItems.Add(trace.RelatedActivityID, new ActivityColumnItem(allActivities[trace.RelatedActivityID], this, activityItemIndics.Count, Analyzer));
                            activityItemIndics.Add(this[trace.RelatedActivityID].ItemIndex, this[trace.RelatedActivityID]);
                        }
                        this[trace.RelatedActivityID].AppendTraceRecord(trace);
                        traceRecordCellItems.Enqueue(this[trace.RelatedActivityID][trace.TraceID]);
                        this[trace.RelatedActivityID][trace.TraceID].RelatedTraceRecordCellItem = this[trace.ActivityID][trace.TraceID];
                        this[trace.ActivityID][trace.TraceID].RelatedTraceRecordCellItem        = this[trace.RelatedActivityID][trace.TraceID];
                        this[trace.ActivityID][trace.TraceID].IsParentTransferTrace             = true;
                    }
                    else if (suppressedActivityIds != null && suppressedActivityIds.Contains(trace.ActivityID) && !suppressedActivityIds.Contains(trace.RelatedActivityID))
                    {
                        if (this[trace.RelatedActivityID] == null)
                        {
                            activityItems.Add(trace.RelatedActivityID, new ActivityColumnItem(allActivities[trace.RelatedActivityID], this, activityItemIndics.Count, Analyzer));
                            activityItemIndics.Add(this[trace.RelatedActivityID].ItemIndex, this[trace.RelatedActivityID]);
                        }
                        this[trace.RelatedActivityID].AppendTraceRecord(trace);
                        traceRecordCellItems.Enqueue(this[trace.RelatedActivityID][trace.TraceID]);
                        result = this[trace.RelatedActivityID][trace.TraceID];
                    }
                    else if (suppressedActivityIds != null && !suppressedActivityIds.Contains(trace.ActivityID) && suppressedActivityIds.Contains(trace.RelatedActivityID))
                    {
                        if (this[trace.ActivityID] == null)
                        {
                            activityItems.Add(trace.ActivityID, new ActivityColumnItem(allActivities[trace.ActivityID], this, activityItemIndics.Count, Analyzer));
                            activityItemIndics.Add(this[trace.ActivityID].ItemIndex, this[trace.ActivityID]);
                        }
                        this[trace.ActivityID].AppendTraceRecord(trace);
                        traceRecordCellItems.Enqueue(this[trace.ActivityID][trace.TraceID]);
                        result = this[trace.ActivityID][trace.TraceID];
                    }
                }
            }
            return(result);
        }
Beispiel #7
0
        private void SortResults()
        {
            Dictionary <int, List <TraceRecord> > dictionary  = new Dictionary <int, List <TraceRecord> >();
            Dictionary <int, List <TraceRecord> > dictionary2 = new Dictionary <int, List <TraceRecord> >();
            long          num           = 0L;
            ExecutionInfo executionInfo = null;
            DateTime      t             = DateTime.MaxValue;

            foreach (TraceRecord value in results.Values)
            {
                if (Parameters == null || !Parameters.SuppressedExecutions.ContainsKey(value.Execution.ExecutionID))
                {
                    num += value.TraceID;
                }
                if (value.Time < t)
                {
                    executionInfo = value.Execution;
                    t             = value.Time;
                }
                if (!dictionary.ContainsKey(value.Execution.ExecutionID))
                {
                    dictionary.Add(value.Execution.ExecutionID, new List <TraceRecord>());
                }
                dictionary[value.Execution.ExecutionID].Add(value);
            }
            renderingHashCode = (int)num;
            SortedList <TraceRecord, int> sortedList = new SortedList <TraceRecord, int>(new TraceRecordComparer());

            foreach (int key in dictionary.Keys)
            {
                sortedList.Add(dictionary[key][0], key);
            }
            for (int i = 0; i < sortedList.Count; i++)
            {
                dictionary2.Add(sortedList.Values[i], dictionary[sortedList.Values[i]]);
            }
            int num2 = (executionInfo != null) ? 1 : 0;
            Queue <ExecutionColumnItem> queue = new Queue <ExecutionColumnItem>();
            ExecutionColumnItem         executionColumnItem = null;

            foreach (int key2 in dictionary2.Keys)
            {
                dictionary2[key2].Sort(new TraceRecordComparer());
                ExecutionColumnItem executionColumnItem2 = null;
                if (executionInfo == null)
                {
                    executionColumnItem2 = new ExecutionColumnItem(dictionary2[key2][0].Execution, ActiveActivity, AllActivities, num2++, suppressedActivityIds, this);
                    queue.Enqueue(executionColumnItem2);
                }
                else
                {
                    executionColumnItem2 = new ExecutionColumnItem(dictionary2[key2][0].Execution, ActiveActivity, AllActivities, (executionInfo.ExecutionID != dictionary2[key2][0].Execution.ExecutionID) ? num2++ : 0, suppressedActivityIds, this);
                    if (executionInfo.ExecutionID == dictionary2[key2][0].Execution.ExecutionID)
                    {
                        executionColumnItem = executionColumnItem2;
                    }
                    else
                    {
                        queue.Enqueue(executionColumnItem2);
                    }
                }
                foreach (TraceRecord item in dictionary2[key2])
                {
                    TraceRecordCellItem traceRecordCellItem = executionColumnItem2.AppendTraceRecord(item);
                    if (traceRecordCellItem != null && (traceRecordCellItem.CurrentTraceRecord.IsMessageSentRecord || traceRecordCellItem.CurrentTraceRecord.IsMessageReceivedRecord || traceRecordCellItem.CurrentTraceRecord.IsMessageLogged))
                    {
                        messageRelatedItems.Add(traceRecordCellItem);
                    }
                }
            }
            if (parameters == null)
            {
                parameters = new ActivityTraceModeAnalyzerParameters();
            }
            if (executionColumnItem != null && executionColumnItem.ActivityColumnCount != 0)
            {
                if (!Parameters.SuppressedExecutions.ContainsKey(executionColumnItem.CurrentExecutionInfo.ExecutionID))
                {
                    executionItems.Add(executionColumnItem);
                }
                allInvolvedExecutionItems.Add(executionColumnItem);
                Parameters.PushExecutionColumnItem(executionColumnItem);
            }
            while (queue.Count != 0)
            {
                ExecutionColumnItem executionColumnItem3 = queue.Dequeue();
                if (executionColumnItem3.ActivityColumnCount != 0)
                {
                    if (!Parameters.SuppressedExecutions.ContainsKey(executionColumnItem3.CurrentExecutionInfo.ExecutionID))
                    {
                        executionItems.Add(executionColumnItem3);
                    }
                    allInvolvedExecutionItems.Add(executionColumnItem3);
                    parameters.PushExecutionColumnItem(executionColumnItem3);
                }
            }
            Parameters.ReorderExecutionColumnItems(executionItems);
            AnalyzeCrossExecutionMessageExchange();
            AnalyzePairedActivities();
        }