Beispiel #1
0
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }

            StackHashEventInfoCollection events = obj as StackHashEventInfoCollection;

            if (events.Count != this.Count)
            {
                return(-1);
            }

            foreach (StackHashEventInfo thisEventInfo in this)
            {
                StackHashEventInfo matchingEventInfo = events.FindEventInfo(thisEventInfo);

                if (matchingEventInfo == null)
                {
                    return(-1);
                }
            }

            // Must be a match.
            return(0);
        }
Beispiel #2
0
        public StackHashEventInfoCollection Normalize()
        {
            StackHashEventInfoCollection newEventInfos = new StackHashEventInfoCollection();

            foreach (StackHashEventInfo eventInfo in this)
            {
                StackHashEventInfo newEventInfo = eventInfo.Normalize();

                StackHashEventInfo foundEventInfo = newEventInfos.FindEventInfo(newEventInfo);

                if (foundEventInfo == null)
                {
                    newEventInfos.Add(newEventInfo);
                }
                else
                {
                    foundEventInfo.TotalHits += newEventInfo.TotalHits;
                }
            }

            return(newEventInfos);
        }